Hmmm. Too bad...
I have taken a quick look into your code. Since you rely on the radar coverage map for counting units, perhaps you could determine the position of the radar and the position of the enemy unit. If the difference is bigger than the chosen max scan radius, the enemy unit is not counted. This way, you could still be able to limit the scan radius like I have suggested in my OP.
The incorrect setting of max_distance_of_sector_revealed by Bob's Warfare mod is in this case just another topic.
Anyway. Thanks for your very fast reply.