Can you get ban for using this script on Twitch with your Twitch.tv account?
No idea. I doubt it, although it would not surprise me though as I would imagine the nickname color system was never meant to be used this way.
Anyways, I was bored, I took the code a tiny step further and now it will never repeat your current color by chance when changing colors. You'll need Twitch msgtags enabled for it to work.
Code:
ON *:TEXT:*:#: {
IF ($nick == $me) {
VAR %hex 000000 FF00FF 00FFFF FFFF00 FFFFFF
VAR %hex $remtok(%hex,$remove($msgtags(color).key,$chr(35)),0,32)
MSG $chan .color $chr(35) $+ $gettok(%hex,$rand(1,$numtok(%hex,32)),32)
}
}