It's possible, but a better question is whether everyone else in channel wants you to do this. From your choice of colors, because depending on the shade of gray you're talking about, it's going to be either hard to see against a white background, or hard to see against black. So, the only way to make sure your text looks fine for everyone else is to send the background color too, which will annoy everyone who's using the opposite color of background. Also, you have 2 choices for which color codes to use. The color index 0-15 is supported by more not-mirc clients, but they can also be configured to be a different red/green/blue color shade, so it's not guaranteed that everyone else's color index 4 looks red to them. So, on the other hand, you can send colors in the range 16-98 range which can't be changed by other people, but these colors are not supported by all not-mirc clients either, which results in them either ignoring the color index or showing it as black-on-black.
Here's an example of doing it where only yourself can see it:
//echo -a $chr(3) $+ 52[ $+ $chr(3) $+ 96message goes here $+ $chr(3) $+ 52]
It wasn't clear which gray you wanted, so the 96 might need to be changed slightly. Some people may find gray to have insufficient contrast against red, as with the default color set this is one of the hardest to read:
//echo -a $chr(3) $+ 4,14 test message is hard to read
//echo -a $chr(3) $+ 14,4 test message is hard to read
If you still want to do it, and have it be done automatic, you'd need to do something like:
edit: added 3 lines so it won't send a /command to channel and can be overridden by pressing ctrl+enter, and won't mess with things being pasted
on *:INPUT:*:{
if (/* iswm $1) return
if ($inpaste) return
if ($ctrlenter) return
if (!$istok(channel query,$window($active).type,32)) return
msg $active $chr(3) $+ 52[ $+ $chr(3) $+ 96 $+ $1- $+ $chr(3) $+ 52]
halt
}
if you do it automatically, you should probably have a way of either whitelisting or blacklisting destinations, so it only goes to some places and not others. Because I can guarantee that this behavior will get you banned from some channels.