in non combat mode your target filter is set to ALL (enemies, neutrals and allies) so your tab targetting will cycle through the lot

once you start combat it changes to OTHERS (enemies, neutrals)

there are keybinds that have blank entries as default. this are targetting filters. you can set them to a key so you enable ENEMY filter instead of OTHERS while in combat so even if you tab target it will only pick RED targets and never TAB onto some random non agroed mob. not sure if this filter can be made a macro so you can put this special filtered 'TAB' version to replace your current TAB action though.