To detect dynamic lights, there are several functions - look for ent_nextlight or view_to_light. TEX_COLOR was an old A6 variable for storing the shadowmap, and was long ago replaced by CONTACT. It had nothing to do with detecting dynamic lights.

As to the stopping of the hinge, does this only happen with the tilt, or also with the pan angle?