im just not good at securing it simplifying the code
Secutiry is just part of the job, you have to take care for that the same way you have to make the code working as you want.
I understand that for you it's just something you don't want to deal with and that you would prefer to have the fully working code, but security isn't something you can be lazy with, in case you didn't read the link I gave you, it means that people can execute code on your machine, ie. they can delete files etc, you don't want that to happen so please see the thread and fix the code before doing anything else.
In the meantime, you can check if $2 starts with a '!' by using for example if (!* iswm $2) or if ($left($2,1) == !)