How are colours assigned to the World vs. World vs. World servers?

Your server's WvW colour (i.e. green/blue/red) is determined by your current matchup and rank. As you suspect, the top team in each set of three currently gets assigned to green, the second to blue, and the third to red (currently this happens weekly). The reasoning behind this is that red is (only ever so slightly, since the three Borderlands maps are identical and the Eternal Battlegrounds are very similar for all three sides) easier than blue while green is (ever so slightly) harder.

To see your current position and likely next position, you can have a look at http://mos.millenium.org/matchups#NA which is updated regularly with scores and has more information than ANet's own leaderboards.

The good news is that plans were recently announced on the forums to rotate the colours more often, which will allow you to more easily explore WvW from a different starting point (of course, being WvW, there are no guarantees that anyone will be in control of specific areas at any given time). As Devon Carver states in a later post in the same thread, "While [world completion] would certainly be a side effect of the change, I’d like to do it because it will add a small amount of variety to the matchups, nothing more and nothing less."

To address your concern in your comment to your question, there is nothing you need to "discover" for world completion that depends on which Borderland is yours. The only thing in areas reachable for only one team are waypoints, but since they're all marked as discovered by default, nothing is unreachable. Of course some POIs and vistas require access to certain garrisons etc., so you'll have to hope your side captures them unless you're willing to switch servers.