I believe I resolved the issue with @BruceConnor's case, needing to wait for the script to execute before it can work.
- I created a new filter that looks for anything in the inbox
- assigns the "i" label (which is created by his version)
Gmail complains that the filter will never match anything, but in this case it does match all incoming messages that stay in the inbox.
The result is that all new incoming messages are automatically "memorized" by this tag, then when you hit archive the script can compare the inbox list with the "i" label and know which ones were just archived, and then mark only those as "read". You don't have to wait to archive, because all messages are assigned into the archive "i" queue.
Bonus: I also set the new "i" label to "Hide in message list" and "Hide in label list", so it never shows up at all. (Click the little arrow next to the new "i" label and choose these options.)