Lol I didn't even notice you posted that version, it's indeed very similar. Though after checking now, I have the feeling HAMM3R didn't really pay attention to the important differences with our code versus his. Now he knows exactly why his method is less preferable.

Btw you don't need to use $scid($cid).network since the raw event is always returned on the network the ison was sent to, thus $network will always contain the right value.

One other detail: set %search. [ $+ [ %scon ] ] on <-- you don't ever need to specify evaluation brackets when setting a variable. set %search. $+ %scon will work in all cases. This is not the case for unsetting though, although it works in some occasions.