I was thinking of something simpler, like this: .if t .if \n(.g \{\ . ds fC \f(CR . ds fP \fP .\}
and then surrounding constant-width text with \*(fC and \*(fP. This should be legible with older troff without worrying whether the older troff supports CW. For older troff, being legible is good enough.