A "melee" unit with 20000 range will attack a visible target out of, say, his 128 acquisition range if ordered to.
Replacement by triggers may be a solution, but loss of selection is awkward and the variables for avoiding it are a pain in the ass.
A footman with a range increase upgrade will still be able to attack ground units only, as if his sword was enlarged.
Metamorphosis/Bear Form/Crow Form is the best solution.