The AI will fire at ranges of 500m. Snipers and machine gunners in particular. I've been shot by a sniper at over 1km.
Usually the problem is that the shooting loons don't know that the target loons are there. Several possibly solutions. use snipers or blackops in your squad, equipped with ordinary weapons. These units have (I think) better detection characteristics. Or give a couple (not all) of the loons in the shooting group binoculars, that might help a little. Or increase the skill of the shooters.
If you want a scripting solution use a reveal command.