Thanks! I could contribute through code but early on I decided that I’d be more useful and learn more if I was a forum helper than coding add-ons and features. Though some day I might dip my toes into creating an add-on or something.
For an example of enabling/disabling rules you can look at my Delayed Startup rule template on the Marketplace. That shows how to do it in GraalVM JS Scripting (it’s just a one liner really). It can also be done in Blockly or even just UI rules without any code at all. That and rule conditions are two very powerful capabilities that I think are underused, especially by old timers who grew up without UI rules as an option so I like to be sure to bring them up.
One simple case, as you allude to, could be to enable a rule such as Presence Simulation which plays back the states of Items (e.g. lights) from a number of days ago to simulate presence (see Generic Presence Detection which uses the Debounce Rule Template) when a Switch representing presence switches to OFF and then disables it when someone returns.
A long time ago I noticed that there really are just a few problems that pop up over and over again in home automation. I started out by writing Design Pattern Tutorials but as soon as rule templates became a thing I’ve moved most of them, at least the ones that make sense, to rule templates. Why show how to code it when I can offer a full implementation that you can just install and configure.