Are we allowed to use the Lua API to assist with the creation of assets? Or is the CGI ban strictly on entire images being uploaded to the store? Or is there a lot more nuance than that?
I'd say it's only banned if most of the creative factor in your save resides in a part that was generated by CGI. For example, if you made a printer that could print huge colourful images and you demoed it with a well known image off the internet, that would be fine even if you transferred the image data into the save via some form of CGI. The exceptions are generally saves that don't focus on the CGI part.
Note that this is not an authoritative answer but simply one of experience, though I wouldn't be surprised if the mod team had the same idea.
Say I construct a city and want to retouch parts of it. Would I be allowed to import the save into Photoshop, retouch the sand, and use a script to apply the changes to the sand as dcolor? Of course, a city made entirely in Photoshop, of METL, and dcolor'd into looking like a New York skyline would be banned, and I want to make it clear that that's not what I'm doing.
To give another example that touches upon what @LBPHacker described, which I think he'd know a lot more about, would an assembler (written outside the game) that generates instructions for a computer (inside the game) be okay?
edit: Thanks for the quick replies, by the way! I expected to have to wait a few days, not a few minutes!
Assemblers are perfectly fine :P Done it a few times. Retouching I'd consider okay if the save has aesthetic / functional / other value even with the deco layer disabled. Nope, scratch that, completely against Rule G6. See also the actually authoritative moderator response below.