I think that points to a very strategic question on the defender and aggressor. It looks like some good strategy thinking here.
I'm not sure your missing any mechanic at the moment, but the aggressor does appear to have the defender in a bad way here. You have to choose and that makes this a great strategic moment. What object is more important to you, and how do you optimally defend everything.
When given an aggressor and defender with equal number of units and the defender having two strategic locations to protect, the attacker is always at the advantage over the defender. There is no question there, but you brought up the strategic question, what is more valuable: the shipyard or the planet?
On the face of the problem they seem to be equally important. But if you have exactly one planet left, then obviously the planet is the more important of the items. If you have multiple planets, and one shipyard, then the shipyard seems to be more important, as you can always take back the lost planet once you beef yourself up a bit. But then again, when you have multiples of either who knows what is more strategically important. You can always rebuild the shipyard once the attacker leaves, but then you can always reclaim the planet once the attacker leaves... a real strategic choice in the game.