It's an issue with twitch (IRC servers in general though) when you send too many commands too quickly, the server simply processes your requests slower in order not to get laggy.

You have to make a queue/antiflood system for your bot.

Whenever you are sending a message, instead of sending it (/msg), add the message to a queue.

Run a timer that periodically (every two seconds in my code below) check the queue, pop a message from it, and send it.
This way, across all channels, your bot is always ever sending a new message each 2 seconds (of course this can be improved by changing the frequency based on the activity of channels, or you can make a queue for each channel possibly and change the frequency of that channel's queue based on the channel activity (easier?))

Code:
alias queue_push {
  if (!$window(@queue)) window -h @queue
  aline @queue $1
}
alias queue_pop {
  var %tok = $line(@queue, 1)
  if (!$line(@queue,0)) window -c @queue
  else dline @queue 1
  return %tok
}

on *:LOGON:*:{
raw CAP REQ :twitch.tv/membership
raw CAP REQ :twitch.tv/tags
raw CAP REQ :twitch.tv/commands
/debug @raw

;you can get millisecond support, here 1500 ms aka 1 second and a half
;.timerqueuechecking -m 0 1500 if ($queue_pop != $!null) $!v1
.timerqueuechecking 0 2 if ($queue_pop != $!null) $!v1
}

raw USERNOTICE:*:{
if (($msgtags(msg-id).key == subgift) && ($1 == #couragejd)) {
var %nick_from $iif($msgtags(display-name).key, $v1, $msgtags(login).key) , %nick_to $iif($msgtags(msg-param-recipient-display-name).key, $v1, $msgtags(msg-param-recipient-user-name).key)
queue_push describe $1 keviskAww NEW SUB!! courageHEART Thank you %nick_to for subscribing with a gifted sub from %nick_from courageLOGO ausHype courageLOGO 
}

raw USERNOTICE:*:{
if (($msgtags(msg-id).key == sub) && ($1 == #couragejd)) {
var %nick $iif($msgtags(display-name).key, $v1, $msgtags(login).key)
queue_push msg $1 keviskAww NEW SUB!! courageHEART %nick welcome to the Courageous!! courageLOGO ausHype courageLOGO 
}
elseif (($msgtags(msg-id).key == resub) && ($1 == #couragejd)) {
var %nick $iif($msgtags(display-name).key, $v1, $msgtags(login).key)
if ($0 == 1) {
queue_push msg $1 courageLOGO courageHEART RESUB!! %nick welcome back to the courageous for $msgtags(msg-param-months).key months in a row! courageHEART courageLOGO 
}
else {
queue_push msg $1 courageLOGO courageHEART RESUB!! %nick welcome back to the courageous for $msgtags(msg-param-months).key months in a row! courageHEART courageLOGO Left a note: $qt($2-) 
}
}
}
the queue is first in, first out (fifo), this is untested but should work, if not it should give you an idea wink


#mircscripting @ irc.swiftirc.net == the best mIRC help channel