It's a good idea but why not use dynamic variables:
set $+(somevar,$network)
;or
set $+(somevar,$scid)
And then..
ON *:DISCONNECT: {
unset $+(*,$network)
;or
unset $+(*,$scid)
Don't think i'm trying to diss your suggestion i just thought of proposing something
