Ultimately, this war is about democracy and whether or not it can take root in Iraq, and the Middle East. Why did we do invade? To remove the threat of WMD attacks and to install a democratic regime. Because democracies don't attack other democracies and terror-producing radicalism is defused by an open political system.
Obviously Dick Cheney, Rummy and the President must have been aware that if they installed a democracy in Iraq, it would become Shia-dominated and likely to come under Iran's influence. I think they expected the insurgency to be less intense and prolonged, and that we would have more troops available to deal with Iran.
We are in a tricky situation, and there are lots of variables. I'm not sure how the endgame will play out. Military action against Iran is not off the table. Airstrikes would delay their nuclear program, and the situation in Iraq can improve.
Ultimately, we and the Israelis would have to ask ourselves, can we live with a nuclear-armed Iran? Would the Mullahs be willing to sacrifice their regime and millions of Iranian lives in exchange for the destruction of Israel, or an attack on the United States?
Would using a terrorist outfit as a proxy protect them? I doubt it. There are ways to tell who made what. We would take them out, regardless.
Ahmadinejad seems like a dangerous fanatic, but I'm not sure if he would be willing to turn all of Iran into a suicide bomb. But a nuclear-armed Iran as a regional superpower would be a disaster for us all.