Thats an ugly ugly hack. And honestly, I really wish people wouldn't even post things like this. It's obvious switch isn't needed, as the original poster said, if/else works just fine. We aren't saying "is there a way this can be done?" we are saying "here is a better way to do this, please implement it".

Using $istok like you have there won't work in all situations. Example:

test {
if ($istok(1.2.2.3.3.4,$1,46)) { goto $1 }
else { goto default }
:1.2
echo -a 1.2
goto endcase
:2.3
echo -a 2.3
goto endcase
:3.4
echo -a 3.4
goto endcase
:default
echo -a DEFAULT
:endcase
}
/test 1.2
DEFAULT
/test 2.3
DEFAULT
/test 3.4
DEFAULT

If that were in a switch() it wouldn't have gone to the default, it would have gone to the case for 1.2, 2.3, and 3.4