Foreclosure is an awful thing. Rewriting contracts willy-nilly is also an awful thing. And moral hazard is a Real Problem.
So, if I were king, my solution to the foreclosure crisis would be the following:
1. Create a temporary state called "in-place foreclosure". At the lender's choice, allow an RTC-style entity buy the house from the lender, but let the buyer stay in the house and rent the place for a period of several years. This rent should be an affordable percentage of the person's household income. The price would be local market price; yes, the lender would likely take a big haircut.
After several years of "probation", the buyer can petition to re-buy the house at a market price with a market-rate fixed mortgage. The buyer would be responsible for maintaining the house and part of the early rent would go towards a deposit that would be refunded to the buyer or credited toward a down payment - or used for repairs if the buyer trashes the place.
If they don't pay the rent in the meantime, they're evicted. If they choose to move away during the "probation" period, they can choose to do so and the holding entity can then sell the house or rent it again.
The purpose of this approach isn't to reward "foreclose-ees", but to avoid neighborhood collapse due to mass foreclosure, to let the market clear quickly, and to minimize moral hazard.
One other point: I'd only allow this in places where the market is thin and the chance of "neighborhood failure" due to mass foreclosure is high. Places with active RE markets would not qualify. For example, in CA, Modesto and Stockton would likely qualify, while San Jose would not.