Another update,
I finished the implementation for this. I tested using thunderbird+macmail. I set some flags, deleted the account, IMAP migrated the data to a new account, connected to thunderbird+macmail to the new account, and... the flags stayed! So this is good!
However, in my testing, even though eM Client has custom tags/flags and we advertised to the client that we'd accept custom tags they were not syncing any flags except the normal system flags. We have a very good and open channel of communication with eM Client and we'll let them know about this and maybe they can touch it up to work as expected.
More of my testing and implementation revealed that we will NOT be able to tie in Thunderbird and MacMail's custom tags/flags to our categories. So the flags set in one type of client may not sync to another type of client. No flag data should be lost.
For example,
-mac mail's flags came over as $MailFlagBit0, $MailFlagBit1, $MailFlagBit2, etc
-thunderbird's flags came over as $label1, $label2, $label3, etc.
-mac mail wont see thunderbird flags, thunderbird wont see macmail flags
-webmail may not see any of these flags by clients
-no flag data should be lost if you use two different clients and modify the flags of an email, unless that client chooses to replace ALL the flags on the message, which I didn't see happen at least with the 2 clients I tried.
TL;DR:
Clients will retain their custom flags but the custom flags won't automatically map to other client's flags, unless their names match. We will now also pull all custom flags during a mailbox migration/retrieval and send all custom flags to the clients that request them via IMAP. Yay!
EDIT:
Only the first 5 main categories for thunderbird are $label1, $label2, etc.
If you delete all the default thunderbird tags and create new ones or rename the pre-existing ones to match categories (tags) in webmail they will sync. This will further sync with the exchange clients too. Theoretically, you can have Thunderbird, Outlook MAPI, Webmail, and Outlook for Mac all syncing the same flags/categories for mail messages, super cool!