Why not just make it so PCs can only flee when they are out of Line-Of-Sight of all the enemies in the encounter? It would prevent the cheesy "just out of arm's reach" fleeing and allow some creative use of smoke screens, blind, stealth, and invisibility when needed. If an enemy is petrified, frozen, stunned, or blinded, they should also not inhibit a character from fleeing. (If you can hard CC all enemies within threatening range, you've probably already won that battle anyway).

Additionally, you should not be able to flee while within a hazardous surface (like oil, fire, poison clouds, ice, etc). Other conditions such as Crippled or Blinded could prevent fleeing, too.