Like kerstt has said, using regex would catch the badwords easier.
Ex: Rather than \"if (%bchk isin $1-) { }\" use \"if ($regex($1-,%bchk) == 1) { }\".
This would catch the same thing, but in some cases may work better.