The Lua management function 'VPOP3.RenameFolder' renames a folder for the specified user.
VPOP3.RenameFolder(username, folder, newname);
Note that folder names are in the IMAP4 UTF-7 encoding not plain text (see RFC 3501 section 5.1.3)