Well, always at least get yourself in the Green on these planets. If it's in the heart of your planets i.e. your opponent won't get to it for a long time then definitely. I'm always wary of building trade ports very early, within the first hour that is, because tradeports take time and plenty of credits/resources to make them.
My order is up the planet, get a fleet that can defend the planets, and then tradeports. You can do these simultaneously, but be wary of building a lot of trade ports if you think you may soon be attacked.