Yes, the app password is the key. Pasting the 16 alpha-numeric random
app password into my script replacing my regular password did the trick.
The option to generate an app password is grayed out until you enable
2-step Verification.
So go to your google account settings at
myaccount.google.com, pick the
"Security" option at left, and turn on the 2-step Verification.
At this point before, a grayed-out "create app password" option below
came to life, but it doesn't seem to be there now! Putting app in the
"search google account" brought up some options, including the app
password, and selecting that brought up the app password dialog!
It's warning me that I should make sure I really need it before I do it,
so perhaps it knew I had been denied access with my script and hence
made it easier to do before. Or perhaps it knows I already have an app
password now, which I can use for multiple apps. Definitely I would try
re-using the one I have before I created a new one. The complexity of
Google is incredible.
--Tim