Kelder is correct, the first if-statement always evaluates to $true, and it is also unnecessary. If there is a color code present, it will be stripped out by $strip, otherwise nothing will be removed. I altered the $strip command in the example to only remove color codes (that's all that was asked).

Code:
on ^*:TEXT:*:#: {
  echo -t $chan $+(<,$nick,>) $iif($nick isop $chan,$1-,$strip($1-,[color:red]c[/color]))
  haltdef
}
}


-genius_at_work