if (!$istok($me,$nick($active,%x),32))
can simply be changed to
if ($me != $nick($active,%x),32))
(Unless you are going to add an exclude list.)
Also you might want to add a timer so there would be a delay on each slap.