may be set %Var2 $upper(%Var2) | say %Var2 | halt have to be set %Var2 $upper(%Var3) | say %Var2 | halt
but why u unset the variable you can just set it but you can use /var too
where is the condition if (%script) ????
your code can be like this
on *:input:*:{
if (%script) && ($left($1,1) != /) {
var %x 1
while $gettok($1-,%x,32) {
var %r %r $upper($left($v1,1)) $+ $mid($v1,2)
inc %x
}
say %r
halt
}
}