Jethro_, if you use $$2 then there is no need for $$1 because if $2 then there must be $1.
if ($$1 isnum 0-9) || ($$1 !isnum) {
can be rewritten as
if ($$1 isnum 0-9 || $1 !isnum) {
because if !$1 then it would have been halted by $v1