MoO2 had what I believe was called an Orbital Defense Station.
Being able to build something like that, I think, would be more senseable then something as basic as a shipyard having any significant defenses mounted on it.
That's basically the concept behind the defense meter, except you don't build them explicitly, but research techs that allow an ever-increasing defense meter growth.
The imperial palace already gives a +5 to defense, so adding a few more points to the shipyard, which should generally only be at your homeworld in the early game, isn't going to change much.
If planets are too lightly defended in the early game (which i'm not sure of) a better solution would be to make Planetary Defense Network easier/cheaper to get to in the tech tree.
We very much want to avoid buildings that you would tend to build in most/all systems or planets. Buildings should make their location special and specialized.