When you leave a battle, you have 20 seconds of "god mode" in which you cannot be attacked. So, even if you get tagged, right atfer these 20 seconds, it takes another 20 seconds for the tag to start a battle. In these 40 seconds you can easily repair your ship and fill up crew. Crew can even be refilled from battle result screen.