There may be a lot better answer coming. I am not the big IMAP user.
The email stays on the server until you delete it, so there is no need to back that up
I believe that if you include your IMAP folders in your backup path, it will catch all the setting particular to the Bat.
The best way to back up is to back up the entire mail folder + the RIT key in the registry[HKEY_CURRENT_USER\Software\RIT]
You can make a batch file to place it in the backup if you wish