I don't have time to write up the warning/ban thing (it's basically just setting a variable or using a hash table or whatever for each nick, but I need to leave for work soon), but just as a word of warning... your script will warn/kick/ban someone who says:

LOL

You may want to set it to only do it if the total $len of the text (including caps) is > 6 or something like that.