I think we need to be careful who we use force against. Force should be the last response, not the first. Diplomatic solutions do not always work, but there are other ways to strengthen our position- for example economic ones. We can refuse to trade with a country before we blockade it, for example.
I don't think we can make a blanket rule about this. We have to take into account the extent to which the countries "harbor" terrorists. The more the country helps terrorists, the more we should use military force. If a country allows one or two suspected terrorists to live there, we probably shouldn't. If it has full-blown terrorist training camps, we probably should.
There are many foreign countries known to harbor terrorists--Pakistan, Yemen and Libya being just a few. Should we use military force--i.e. invade--all of these known countries? No. We should negotiate diplomatically and, if necessary, cut all financial and trade ties (but we won't ever do this to petroleum-rich countries) and sever all travel visas, but the last thing the U. S. needs is another witch hunt on foreign soil. I did support the decision to invade Afghanistan in order to to take care of the Al-Qaeda terrorists there, but I opposed the invasion of Iraq based on the search for non-existent WMDs.