On the topic of not always retreating through the nearest wormhole, IIRC, it was stated in an FAQ on the wiki that this was a deliberate decision. Chris knows that players are really good at exploiting any source of deterministic bahavior, even those that seem optimal.
Yea, this particular behavior could likely use a tweak (like 75% chance of nearest wormhole that leads to AI system, 25% chance random choice like today, on a per ship basis), but I think some non-determinism is good.
The coming right back in right after retreat...yea, that sounds like a straight up bug.
Hmm, I wonder if I should start a new thread to compile a list of "high priority" bugs and "quick" balance tweaks...