Why not use something like this
Code:
on *:dialog:name:*:*:{
var %x = $+($devent,$did)
:init0 (you can put a comment here if you want)
blah
return
:sclick1
blah
return
:%x
}

Not sure if solves your problem but I find it much neater and easier to read.