Ok, I had some ico's in a folder and it seems if one has any ico in the project that the ico plugin will pop up for export options at some point depending on what is called(in my case, doc.Trim()). It only does this once after project load. My script was ignoring all the ico files I had so I thought it shouldn't matter. Seems to be some kind of initialization issue with the plugin.

Ultimately rasterizing all imported ico's is the solution. Any lingering ico files will trigger the plugin and break the flow.