There is no way to do this, that I know of, via scripting. When the AI uses what mode is all defined in the weapon's config.
A unit's skill rating will affect how fast it shoots, though, and might possibly make them switch modes at certain ranges. The higher the skill, the faster a unit shoots, so try to set their skill to the max.