Here's one that uses ',' as a trigger, so it'll search for a matching nickname if a comma is used at the front of the first word. Colors the nickname, any more and it's likely to be quite annoying for others in the channel

Code:
alias randcol {
  var %i = $len($1),%t
  while (%i) {
    %t = $+(,$base($r(1,15),10,10,2),$mid($1,%i,1),%t)
    dec %i
  }
  return %t $+ 99
}


on *:input:#:{
  if (*, iswm $1) && ($nick(#,$fline(#,$replace($1,$chr(44),*),1,1))) {
    say $randcol($v1) $+ , $2-
    halt
  }
}


Note you can use $randcol(text) as an custom identifier in other parts of your script to return randomly colored text