Does Google Apps Script expose an API to do this though? It would be easier to download an html page from within GDocs without having to run something locally.
Note that it will be a HTML plus directory of images, so you need to return an archive.
After years of trying to edit things locally and share/publish on Google Docs I gave up.
You either have to commit fully to Google Docs or sidestep. I'm sidestepping with smalldocs at this time.