America won't go to war with Pakistan for a number of reasons:
Troops Shortage: To take America will easily need over 0.5 million men along with their supplies/Tanks/Artillery/Aircraft, etc. Which would be impractical. Moving such huge numbers half-way across the world is expensive business. The American economy already strained by the Wars in Iraq and Afghanistan cannot sustain such a large military offensive.
Point of entry: To attack Pakistan, the Americans need a point of entry. China and Iran will not provide it to the Americans. Afghanistan is landlocked, so the Americans can't move 0.5 million troops along with Tanks/Artillery through there. India is a possibility however, allowing the Americans to land in India will hardly go unnoticed. Allowing us time to prepare our defences and play diplomacy.
The PA Factor: Pakistan is not Afghanistan or Iraq, it has a well-established and professional military who's operational commitment has been lauded by a number of military historians and professionals. Chuck Yeager himself said that: "The level of commitment of the men of Pak Army is a deterrent in itself". Not only are our soldiers committed, but they are also armed to the teeth with highly dependable weaponry.
When in Pakistan, buy an AK-47: One of the best and worst thing about Pakistan is that EVERYONE has a semi-automatic assault rifle laying about at home. Whereas this might cause problems in preventing terrorism in normal days, in the case of an American attack, it means that raising a militia will take minutes if not seconds. These militias may add to the fighting strength of the PA if needed or defend their own towns/cities.
Unpopularity of America: Only about 11% of Pakistani don't believe that America is Pakistan's enemy, but it is not necessary that they should also hold a positive view of America, they just said that America is not our enemy. Quit loading things. Which means that if the Americans attack, they will not be welcomed by cheering civilians like in Iraq or Afghanistan. On the contrary, it will be a very horrifying welcome.
The China Factor: China is "Flexing it's muscles and preparing to become the next superpower", these are the word of an American journalists who's work I read in 2008. If America does attack Pakistan, it will be China's golden opportunity to dethrone America and become the superpower itself without even lifting a finger. In an on-going war, all they will have to ensure is that we do not run out of ammo and we will just be serving their interests while fighting for ourselves. Should the shyte really hit the fan. The Chinese may also choose to intervene as in Korea. Should that happen, then American forces in Pakistan will have to prepare for a massive surrender, a hasty retreat or a massacre.
Above stated are only some of the reasons that come to my mind that will discourage America from attacking Pakistan. Being short on time, I cannot jot down any more(for now).