Probably something like this and I'll explain why.
It'll be much closer than Obama's win, but Edwards would likely pull it off. The affair scandal hit (way) back before the Democratic convention in August, which not only would give Edwards time to repair his image (perhaps at the convention?) but also provides a key point in time
before the stock market started nosediving.
The stock market started barreling downward right in the middle of September. Couple that with McCain's already weak standing on economic issues, Bush, and Edwards having made the economy and poverty his number one issues since December 2006 when he announced his campaign, public opinion would likely rebound. Americans are relatively forgiving about things in politics (Hello 65% approval President Clinton) and not to mention their incredibly short attention span.
Edwards could immediately take charge on the issue he's already perceived as strong on, and accuse McCain of playing politics and not paying attention to the issues when the McCain campaign attempts to push the economic plunge out of the headlines (another component of our short attention span) just like Obama did to McCain with great effect on the issue of foreign policy and "palling around with terrorists."
As I said, it would be closer than Obama's win, Obama did afterall run a flawless campaign. But when we consider Obama's huge win (notwithstanding the fact that he's black, that probably held him back Missouri) and the advantage Democrats have on the economy and various other issues because of the failure of the Bush Administration, it's difficult to imagine an Edwards loss.
To have Edwards lose you would likely have to have the affair break
after the beginning of economic collapse, have Edwards pick a mediocre VP, and have McCain pick and amazing VP. But by then you're just being ridiculous.
Edwards win, 289-249.