Some hints:
Let's think of a special event:
let's say an npc pushes another.
You can scan each frame, but it is better to scan in a certain situation only, for instance when the player pushes the push button, or when the npc pushes another, means he is in an attack state and has reached a certain distance to the other, then call c_scan.
In case you have a lot scans within the game, and the more complex your world gets the more you need to assure that they don't interfere, then you should give each scan a scan id.
And, to assure that the other isn't pushed several times from a single event you have to switch the event off (my.event = NULL;)
Probably, you play a sound as well, and that sound should play only once, too.
But, when you set the event to zero, you have to switch it on, at least in the attack state (my.event = npc_event;), before you can use it again.
I describe it as it is in A6 - there could be slightly changes in A7, though.