$cnick() will account for any mode signs included with the nick given, so you can use $cnick($nick(#, nickname).pnick) to get the rank applied.
Hmm, nice trick about the .pnick. Didn't know $cnick would pick that up. Your method is a tad more complex than what I want to script for this occasion. Quite possible, yes, but a little bloated, since after it also needs to be compared to the $cnick entry.
Thanks for the help, but I think I'll just stick to != $color(listbox text) and allow the occasional nickname that's identical to the listbox color to slip through.