That's probably because one or more of those characters are treated as operators/code and not normal characters. To make sure special characters are not evaluated as code, it's a good idea to use $chr.

You can find out what ascii number a character has by using $asc(charater).

Type this for example

//echo -a $asc($)


I'm not sure why $asc({) is not possible, but the number for is 123 anyways.

Code:
if ($chr(36) isin $2-) || ($chr(37) isin $2-) || ($chr(123) isin $2-) { return }


that should work