Looks like this other thread can be modified. The repeat counter only flags when they say something X times in a row, while the flood counter flags when they say anything X times in Y minutes.

So you could modify it so that you would call the flood counter alias only when they did what ever qualifies as spam, in which case it's counting spam incidents within the time frame. Using a hashtable avoids having a rats nest of variables to keep track of people and their messages, allowing each individual message to automagically expire by itself, avoiding a lot of calculation each time they spam.

By resetting when they go offline, does this mean they can cheat by simply doing "/hop" to temporarily exit the channel and restart the timer, or just quit then come back? If you really want that, the :PART: and :QUIT: events could be trapped to forget all their infractions.