If you look at that thread, it has settings for the 'flood' alias to set the number of incidents and the timeframe. So if you change the max.messages variable to be 2, then it takes action against the 3rd. The %timeframe would be 3600 for the number of seconds. This has each infraction be a hashtable item which exists for 3600 seconds, so instead of resetting the counter back to zero, it's a sliding counter which counts the number of incidents which have not yet expired.

Instead of calling the flood alias for each time they speak, you would call it only when they've done something which matches the unspecified spam filter, and it counts only those items. You can test it out by having the actions be an echo message instead of actually doing something.