How to control switch OFF by automation only?

Hi there !

I have a simple Q: why is switching OFF always prio 1 against capture it by automation ?

Or closer: I wanted to create a children cycle protection (KinderSpielSchutz) in automation - for that its necessary to control the switch OFF mechanisms !
The algo is simple:

if switching on by switch - setup a timer e.g .5 minutes
while the timer is running - no switching off at all …
only if the timer comes into idle mode an upcoming switch off command can take place now and only now !!
not necessary to say, I don’t accept bouncing of the lights, e.g. it’ll be recognised its switched off, so quickly switch it on again !!

please help me…

Thanks.