Assume market value, subtract the cost of repairs, carrying costs and headaches then decide how much you want to make on it. If you can buy it at that price or below, give it a shot.
Dan has it right. It is simply a math problem. Figure out the value of the property fixed up, subtract what it would cost to have a licensed contractor fix it up. Subtract that, and about $20k from the price and that is about what you wan to pay. If you can do that, buy it if you want and it will be easy to sell at that point.