If the election is as close as it looks right now, do we have the possibility for a tie in the Electoral College? Or disputed electoral votes, a la Florida in the 2000 or 1876 elections?
If so, then the 12th Amendment to the Constitution will come into effect. That requires that the House of Representatives chooses the President. If Republicans keep their House majority, as projected, Romney should win. But the 12th Amendment contains an interesting wrinkle -- it requires voting by state delegation, with each state having a single vote (just like the good old Articles of Confederation). Given the current composition of the House, Romney would still win by state delegations.
It gets more interesting with the vice presidency, however. The Senate picks the VP, with each Senator having a single vote. If Democrats keep the Senate, which is up for grabs but seems to be leaning Democrat, then Joe Biden could continue as Vice President. It would be interesting to see whether, if the Republicans can gain enough seats for a tie in the Senate, Biden would end up getting to cast the deciding vote for himself.
Now the honorable thing, I think, for Biden to do in this case would be to refuse to be a candidate and allow Ryan to serve as Romney's number two. I believe that Al Gore's finest moment as a public servant was when he refused to contest Florida's electoral votes during the 12th Amendment process after the 2000 elections. But Joe Biden might think he is worthy enough to be the next Thomas Jefferson, who served as vice president despite coming from the party opposite the President -- indeed, it was his election as vice president (because he came in second to John Adams in the presidential election of 1796) that identified the need for the 12th Amendment (well, that plus that pesky Aaron Burr almost winning in 1800 against his own presidential candidate, but Biden hasn't reached Burr levels of ambition -- yet).
One additional thought -- both chambers have quorum requirements of 2/3rds. If that number is right, the Republicans can force a quorum for selection of the President. But in the Senate, the Republicans could deny the Democrats a quorum for picking the vice president. I'm not sure what happens then. I suppose the office remains vacant, and then, under the 25th Amendment, President Romney would nominate a candidate who would be approved by the House and Senate (as with Gerald Ford replacing Spiro Agnew).
I suppose that would allow Ryan to still become vice president, but not if the Democrats are so mad at the Republicans for denying Biden the quorum needed that they refuse to confirm Ryan.