1. Create a new Label named "To Export".
2. Drag the messages you want to archive to the label.
3. Right-click the label, choose "Export" and save as archived.mbs.
If Opera complains about bodies not being downloaded, tell it to download them. Then, try to export again.
4. Goto "Mail and Chat Accounts -> add -> import email -> import generic mbox". Click "add mbox" and browse to archived.mbs. Then, import into a new account.
5. Goto "Mail and chat accounts -> the account you just created -> edit -> general tab" and change the account name to "IMAP Archive".
6. Right-click in the mail panel and set "Show Messages From' to "IMAP Archive". Then, open the "All Messages/Received" view. Verify that the messages were imported correctly by opening them and seeing that their bodies load and that you can save their attachments etc.
In "Shift + F12 -> buttons -> mail", there's an account selector drop-down that you can add to the mail panel toolbar to make it easier to switch accounts.
Also note that "Show messages from" gets reset to "All Accounts" on startup.
7. Now that you know your messages were exported and imported into the archive account correctly, you can delete the messages off of the IMAP server. Set "Show Messages From" to your IMAP account, open the "To Export" label view, ctrl + a and shift + del. That will remove them from the server and Opera's IMAP cache and they'll only be present in the archive account now.
The next time you choose to import an archived.mbs file, choose to import into the "IMAP Archive" account instead of a new one.