I would change this line
if ($me isin $1-) && ($target != $active) {
to
if ($me == $1-) && ($target != $active) {
because, the isin will cause a trigger by words containing your nick ie my nick is Im and someone says immune.
just a thought.