You probably want $window(<window>).sbcolor

Returns "message" if the window's switchbar button has the message colour, ie if it hasn't been looked at yet, otherwise $null.