Luckily, my kids have outgrown that phase ... but back in the day, I used Indigo to handle it, even when controlling a load. Honestly, I don't recall all the methods, because it depended upon how / when they were messing with stuff... Here's what I do remember...they were triggers based upon variables and switch inputs. Someone posted a script to return a light to it's prior state, which I had incorporated in some instances. They had favorite light switches in favorite rooms, so I only did it for those few switches.
Here's one example for the bedrooms - a muy favorite switch of my son's to avoid going to sleep and generally driving anyone over 3 insane:
If variable SonSwitchMellow was true:
Trigger: If "On command" received, run script to return to prior state.
Trigger: If "Of command" received, run script to return to prior state.
Trigger: If double click On, turn On
Trigger: If double click Off, turn Off.
Similarly, if variable: KeepTheDamnLightOff is True (useful at bedtime and other times)
Trigger: if light state <> off, turn off light
Trigger: if double click On received, set variable KeepTheDamnLiftOff variable to false.
They didn't immediately stop,, but eventually a computer's rigid repletion will tire/bore/defeat even a 3 year old.
We still use a version of one of these tactics since our kids are young enough that bedtime is serious. So, after 8pm, if one of their lights turns on, it triggers an Insteon Scene that SLOWLY dims the light to Off over many, many minutes (whatever Insteon allows, maybe 8 minutes?). We can override that by double clicking a keypad button so that the light says on via a variable condition. This was something we had programmed into our kids rooms because they would awaken in the middle of the night and turn on a light - which makes for a really crabby kid in the morning, even if the parents are lucky or exhausted enough to sleep through it.
Jay and Matt might want to add a "Parenting Hacks" subsection to the forum. I'm concerned about how to have the kids make my kids tolerable when they reach the teen years.