here is the thing(i think)
Set the Heroes Range to 1000(or something, the maximum range you like) and the Acuition(or however its spelled) too 100(Melee Range)
The Default will now be Melee range
Now, make the unit pick up an item
Event : Unit Aquires an Item
Condition : Item Being Manipulated equal to ITEM
Action : Set Acuition Range of Manipulating Hero to 500(A medium long range)
Now, after that, make a similar trigger that has an Event like Unit Drops Item or something like that with the same condition(or something alike) with a Action that sets the Acuition Range back to 100(Melee Range)
i think that should cover it, since its the acuition range makes the limit of how far the unit can attack
or you can just use upgrades, since i think there is one for that too