Terraforming: High initial cost, no cost over time (assuming it's finished).
Importing stuff to make up for a bad environment: No initial cost, high cost over time.
The terraforming cost should stay constant, but importing should become more expensive the more people who live on the habitable planet. And the further away it is, the more expensive it becomes as well. Technological advancements would probably decrease the cost over time, but it would still be expensive.
I think it's unlikely that the import cost will intersect the terraforming cost when there are less than some thousands of people living on the planet. It also depends on how close the planet is to what we would need to survive normally... What we should do depends on so many things which could be different on different habitable planets.
But if we're going to make it a permanent colony with naturally living people, terraforming should be one of the earliest things to focus on, to finish it as fast as possible.
I don't think we will ever live on planets just for mining their ores. By that time I think we will have plenty of advanced robots which can do it for us (assuming we don't destroy ourselves).
But what if there is already life on the planet? It would probably not be wheat and trees like on Earth, but very different, and probably not anything we can eat. If there were life forms on our size, it might be hard to get it to coexist with our huge forests of wheat or nuemelons, etc.