That's a complex scenario to consider. While no one ever succeeded the Presidency without being sitting VP, there's some sort of precedent, dating back to the 1970s, when Carl Albert, Democratic Speaker of the House, was quite likely to succeed Nixon amid Dick's possible impeachment and Spiro Agnew's resignation, but he made it clear that if he's in the White House, he'd be merely an Acting President until he can name a Republican VP, since Republicans won the election and have mandate. I imagine there would be strong pressure on Pelosi to follow the suit.
I'd imagine Pelosi would remain as President for a couple of reasons: (1) it is likely that the 2008 election, had McCain won it, would have been very close, perhaps with McCain getting under 50% of the PV, hardly a mandate; (2) the same argument could have been made in 2000 that Gore should have conceded early, as Nixon did in 1960, but Gore disregarded that precedent. I can see Pelosi not rinning in 2012, though.