How to fix "Error while parsing the 'sandbox' attribute" flags error with HtmlService?

This error can be safely ignored, the script will continue to run fine. These are two new flags which have been implemented in Chrome 46 (the current stable release). If you're testing in a browser that doesn't support them, you'll see that error (which is really just a warning).

The allow-modals flag is required because Chrome will, by default, block modal dialogs within a sandboxed iframe. Adding this flag allows modals to work in your apps scripts.

The allow-popups-to-escape-sandbox flag is somewhat similar; its purpose is to permit new windows to be created without them being subject to the same sandboxing restrictions.