Here is my idea of a system that I think it could help preventing flood and also help against the noobs that spam using checkban or rmk...
When someone give a command to the bot, check if there is a variable (integer: "nick"_commands or something like this), if it's false create it with value 0, if it's true (variable exist) check value, if value < 5, then +1, if value > 5, ignore player.
When variable is created also create a countdown (60s) that repeats all the time, when countdown end (and start again) modify variable's value -1, and if value of integer is 0 when countdown end destroy variable and countdown.