Make sure you don't have another on INPUT event that is conflicting. I just tested this and it's working fine.
[21:34:41] 4[15ClassyBot4]4 8test
[21:34:41] 4[15ClassyBot4]4 5test
[21:34:43] 4[15ClassyBot4]4 13test
Also, one thing I'll suggest is to make the colors 2-digit or you'll run into problems.
Change your hardcoded colors (4) to double digit (04). And replace both occurences of $r(1,15) with:
$base($r(1,15),10,10,2)
That will guarantee that you won't have problems with the colors and text starting with a number.