Problems in houses are like spiders. If you're afraid of them, its because you're not sure what they can do. It's hard to separate the dangerous ones from the not dangerous.
So, learning as much as you can about what things cost and what you can see versus can't see within the walls is key. That being said, I am afraid of foundation issues because I don't know enough about how extensive foundation issues can be and how to differentiate minor versus major issues. Guys who work doing foundation for a living might walk into the same property and know exactly what to do about it. So ultimately it's just about learning what things cost and seeing what price you can get the place at and whether the math makes sense. In theory, if it still makes sense to tear a house down and rebuild it financially, you can always do that.(Even though that rarely makes sense). There is always a price though so get to know some contractors and read J Scott's book on estimating rehab costs and you'll be on your way. : )