You might want to use "iswm, like this:
Code:
if (*whatever* iswm $nick) { .kick # $nick $nick $+ , Kicked for Inappropriate nickname. | //write KickLogs.txt ( $+ $date $+ - $+ $time $+ ) $nick $+ , Kicked for Inappropriate nickname.  | /msg $nick Change your Name and try again. }

You also might want to write the person's whois info to your log so you can track whether someone in your channel has been there before with an offensive nick. I'd suggest writing $wildsite to your log. Also remember that this code would need to be changed in an ON NICK event to "if (*whatever* iswm $newnick)"...Hope that helps.