I dont know about a script recognizing patterns. What you could do is an on text event. type /help on text to learn more about it. For your particular situation, i would do something like this:
on 1:TEXT:*oooOOOoOooOOOoOOOoOOO*:#YOURROOM: /ban #YOURROOM $nick
You could also extend the ooooooooo to whatever length. The ban wont recognize the difference of ooo and OOO, so as long as they do excessives, they are banned.
hope this works for you.