While I haven't had a chance just yet to do a more thorough code review of my modifications, I suspect that the cause of the trouble is that the hud_target_closest() function now filters out any object not attacking the player if we're looking for someone attacking a specific object, such as the player.
If that is true, then one solution to the problem would be to add a default parameter to the hud_target_closest method that specifies a maximum distance to consider a target a threat. Another option would be to automatically filter out attackers that are beyond a certain distance.
originally wrote some commented out code that does just that by default for non-players, but the MIN_DISTANCE_TO_CONSIDER_THREAT macro they use is only set to 1500, which is just too short to be effective in FS2 with weapons such as the Prometheus S, Maxim, Tornado, and Trebuchet.
BTW, I like the new title someone bestowed upon me!