The maths in 2004 were bad for Kerry (as was much else). By my reckoning the Democrats would have needed to be 7.2% ahead of the Republicans in the US-wide vote for Kerry to have a chance of catching the 26th state, whereas Bush was still on 26 even if the Republicans were 5.4% behind in national support.
This year things look more even. At present the Democrats control only 15 congressional delegations - Rhode Island, Hawaii, Vermont, Maryland, California, Connecticut, New York, Massachusetts, Delaware, Maine, Oregon, North Carolina, New Jersey, New Mexico and Iowa - with Minnesota evenly divided and the Republicans ahead in the other 34. That's with a Republican lead in the 2010 elections of 51.4% to 44.8% for the Democrats. But a lot of the crucial Republican seats were won by wafer-thin majorities in what was probably a better election than they will have this year: on a swing of less than 1% the Democrats would gain the swing seats in Illinois, Washington, West Virginia, Nevada, and the fifth seat of eight in Minnesota. If the swing is between 2.65% and 3%, the Republicans lose South Dakota, Colorado and Missouri to the Democrats, and the delegations of New Hampshire and Mississippi become evenly divided. NB that the Republicans could still be ahead in the popular vote by a margin of up to 1.3% in this case, but unable to get a majority of state delegations in the House.
However, there would still remain a hill to climb for the Democrats, who in this scenario would hold only 23 state delegations. The next four states to shift - Arizona, Wisconsin, Arkansas and Idaho - would all move from Republican majority to evenly split. Once you hit a 5.05% swing, though - which would mean a Democrat lead nationwide of 3.5% - the Republicans also lose South Carolina and the Democrats pick up Wisconsin, North Dakota and Indiana for their 26th state. (Pennsylvania is not far behind, requiring a 5.1% swing to shift from red to blue.) So the Democrats are disadvantaged, in that they need a larger nationwide vote lead than the Republicans to reach 26 states, but not as badly as was the case in 2004.
These figures are of course not merely speculative but actually wrong. The congressional districts are all being redrawn for this year's election anyway, and eighteen of the fifty states are gaining or losing Representatives. The Washington Post has a good guide to this process, listing each state as to which party controls the redistricting process and what the anticipated outcome is. This will shift the bar overall to the disadvantage of the Democrats, who will lose North Carolina and possibly New Jersey to the Republicans, while the Republicans will lose Illinois (which was very marginal anyway) to the Democrats. The result is probably that the Democrats must be ahead, or nearly so, in the popular vote before the Republicans lose their 26th congressional delegation, and may need a lead of 4% before the 26th state goes blue. Congressional elections are a complex phenomenon, with all the dynamics around incumbency and local issues, and even if the boundaries were not being changed, the detail of the above analysis would be far from 100% accurate in a real-world scenario. But I think it gives a feel for the big picture of what might happen.
The electoral college is, of course, much more likely to produce a clear result than the Twelfth Amendment procedure would, and has only once failed to deliver a majority for a single presidential candidate since 1800. In the unlikely event that the Twelfth Amendment did come into play, it would be pretty nasty, I suspect; much nastier than in 1825 which was bad enough. We would almost certainly be in the grey area where the result of the popular vote was very narrow rather than clear, and a handful of evenly divided state delegations held the balance of power. The fate of the election could rest on the decision of a single Representative from Mississippi, Arizona, Arkansas or Idaho to break with his or her party and vote for the other candidate. Fills you with confidence, doesn't it?
Obviously in such a case, purely idealistic considerations would be the sole preoccupation of the House, and there would be no prospect of political favours being offered by either candidate to any politician who might find themselves in that position; nor would there be any chance of such offers being accepted. Obviously.
(Little remembered fact - the Electoral College succeeded in choosing a Vice-President, without choosing his boss, in 1824; but failed to do so in 1836, the only occasion when the Senate alone chose the Veep under the Twelfth Amendment. But as the 1836 winning presidential candidate's running-mate was only a vote short, the Senate had little hesitation in selecting him. I imagine that in the scenario above the Senate would choose the running-mate of whichever candidate was selected by the House, with grumbling and possibly even high drama but a certain inevitability.)