I may have misread what you meant. You can still have the $strip function using $iif() and $()
on *:text:$($iif($strip($1) == !time,$1)):#:{
This is the same as
if ($strip($1) == !cmd) {
except it's coded within the match text section of the event. And last but not least, you can use regex
on $*:text:/^!time$/iS:#:{
where the /S will strip out all control codes.