In SE III 'Optimal Range' meant that best range to damage the target without getting damaged in return. So, there was some combination of your weapon range and damage considered with the enemy ship's weapon range and damage. In SE IV I think it's simpler, though. I think it just tries to attack from the range where you get max damage from your weapon. I've certainly never seen a ship using 'Optimal' strategy try to open up the distance with an enemy once it had closed, except the Ukra-Tal ships using the modded Plasma Bolt which does more damage at mid-range than close range.