Put archiving behind a feature flag.
Collect all threads that need to be archived and make only one call to the GmailApp.