You simply use FlagMessageByUID method:
using (Imap imap = new Imap())
{
imap.ConnectSSL("imap.gmail.com");
imap.UseBestLogin("pat@gmail.com", "password");
imap.SelectInbox();
long last = imap.GetAll().Last();
imap.FlagMessageByUID(last, Flag.Flagged);
imap.Close();
}
You can also use labels for that purpose:
https://www.limilabs.com/blog/label-message-with-gmail-label
This way you can mark messages that were processed successfully in a different way than those where your application encountered some errors.