A thought has just come to mind...with imap protocol only synchronizing the local messages with the server (the original messages remain on the server until they are purged), this means that the note added to the end of the message is only stored locally, so if the mailbox has to resync with the server, i think the messages will lose the avast note. Is this correct?

You are right that the messages on the server doesn’t contain avast notes. The notes are added on the track between server and Mozilla. But they should be added during each resync.