Hi, I guess that by “flags a message”, you mean to flag the copy of the sent message.
AFAIK there is no way to get the sent message id from the compose message context.
You need to add a notifier to the folder where the message is copied to.
You can look at the (old) addon that I developped RemindIt, that does something similar.