If you are stuck with a crashing Mail application and want to get back to work, quit Mail (if it didn’t do so on its own), go to ~/Library/Mail/ and move the IMAP-$your-account-name@imap-server folder that matches your offline-changed IMAP account to some other folder. Then, restart Mail. It will resync your local copy from your IMAP server. Of course, your changes are not in there. To find them, go into the folder you moved out and dig around :-).
This is not a solution to the problem. It is only a hint to get back to a working Mail quickly.