The question is twofold. First, what values need be exported as variables, what to name the variables, and how to represent those (if any such are needed) that are non-numeric, like the "indexed/RGB" state. As you're proposing the feature, you're tasked with inventing the names. :)
Second, at the moment mtPaint treats only the "%f" sequence differently, leaving all the other "%" signs in place (including not reducing "%%" to "%"); in theory, someone's custom actions could break if some "%whatever" matches what is used for other purpose (some commandline utilities do take format strings for something or other). So, this'll introduce a slight backward incompatibility.