Copied from my comment on the issue:
I'd like to see some improvements on the path finding in general.
The hostile firepower consideration boosting vertex "cost" is a good one.
It would be nice to see something like 2x vertex "cost" if the planet is hostile,
1.25x "cost" if the planet is nuetral, and 1x if the planet is allied.
Even more considerations can be made too (additive or multipictive based on what seems appropriate for each case), like for planetary speed boosts, planetary gravity, any sort of planetary or cross planetary effects in general like AI eyes and raid engines, etc.
But technically, this is outside the scope of this suggestion.
Pathfinding gets really complicated when you start taking other factors into account.
Remember, the fastest way is not necessarily the least number of wormhole hops. Three hops through close together wormholes can easily be faster than two through widely seperated wormholes.
Now, add in things that affect travel times: Enemy held, BHGs, Grav Drills... Or, for that matter, Gravity Guardians, Spire Gavity Drains, etc.
Should auto-pathing include, exclude, or ignore factors like: core world / Homeworld status, presence of Eyes and/or Raid Engines, barracks, Ion Cannons, OMDs, Warhead Interceptors, etc.
There are so many factors that things would quickly get out of hand.
Wingflier's Mantis suggestion is a good way for the human player to prevent issues. It has my vote.