Esc
Macros
New
/script ClearTarget();
/script TargetNearestEnemy();
Done
Put it on an auxillary bar and bind it to tab.
I have my own custom targetting script for focusing fire in parties, and if noone has a target or I'm not in a party, it runs those two script commands and it always works the way I always thought tab was supposed to; give it a try.