The mercifully few terrorist attacks we have suffered in the last few years are little if anything to do with our military endeavours in Afghanistan!
Homeland security (american term I now) and heightened awarness from public are the reason we have foiled and prevented there being many more attacks.
Our presence in Afghanistan and formerly Iraq along with our general foreign policy has made us more, not less of a target.
2012 olympics, guaranteed biggest target for terrorism in a very long time.