In Beginnings Part 2, Vaatu claims he was responsible for "br[eaking] through the divide that separated the plane of spirits from the material world"- in other words, for bringing the Spirit and physical worlds together, and thus (presumably) opening the two portals. Now, this is probably more along the lines of fanfic than evidence-based hypothesis, but what if he did so via the Tree of Time? Its roots supposedly bind the worlds together (and so probably did so prior to the opening of the portals), and in any case, it is connected to all energy in the cosmos. Vaatu could thus have used the Tree to learn about the physical world, then, a la Korra in "Light in the Dark", strengthened himself enough to open the portals. This would also serve to explain why the Avatar has the power to open and seal the portals- Vaatu would of course have power over them, and due to their connection, Raava would presumably have the same power; she then lends that power to her current host. And this would also explain why the portals just happen to be so close to the Tree- otherwise, it seems like an odd coincidence.