There used to be a handful of basic engine guides on the FM blog, but the links to download them seem to be dead. I’m not sure whether they’d really have answered all your questions in the first place.
Most of what I’ve learned, I’ve learned either through looking at other mods or through the game’s source code itself. The source code for 0.99 is available on GitGud. Most of what gets called in user-scripted stuff can be found in ScriptVarsIntegrator.java (in /src/fetishmaster/engine/scripts/), but you’ll also have to dig into the actual methods for Creature and even RNAGene to get a full picture.
In response to your specific questions, GetFlag refers to a global flag, while PerGetFlag/GetPerFlag refers to a personal flag tied to a specific character. Calling a character’s GetFlag (proxy.GetFlag(“flag”), for example) also refers to a personal flag rather than a global one.
updateEffect generally takes two strings and an int - the stat name, the name of the effect, and the value of the effect (a modifier to the named stat). If the stat already has an effect with the same name, the value of that effect is updated with whatever it was just given; otherwise, a new effect is applied with that value. You can also add a fourth value, time, to adjust how long that effect lasts, and in conjunction with it a fifth value, a string to be printed when the effect expires.
LustShame requires a bit more code-hopping to see the full logic of it, as it calls a couple other methods and references stats that really never get used. Essentially, it takes a creature, a lust value, and a shame value as input. Shame is adjusted to generally equal lewdness - shame (or zero if lewdness > shame), arousal is adjusted by, essentially, (lust - adjusted shame) times (libido/10), and mood is adjusted as usual based on original shame amount. There are other factors here that modify all that, but I don’t actually know that they’re used in the base game.