Fixer-uppers can offer excellent value — or become money pits. Here is how to evaluate the financial case for buying a home that needs work.