I disagree with that. We do not *HAVE* to be in Iraq right now. We are choosing to nation build, something Bush promised not to do iirc.
If we had to go to war with Iran, we would forget about nation building in both Afghanistan and Iraq, both Iranian neighbors by the way, and go kick their ass.
Not to mention that the new Iraqi Army would probably be pleased to help us out.
Leaving Iraq and Afghanistan before those nations can manage their own internal security has a significant downside for those nations and ours. That said, those interests can be subordinated to an attack Iran. And I think, if push comes to shove, Iran should be attacked at the expense of security in Iraq and Afghanistan.
Considerations in the equation of a US military strike against Iran are many; i.e. 2006 US election, domestic support, foreign support, Iraq, Afghanistan, the perception of US military might and capability abroad, the need for a military draft, placing the USA on more of a war time footing. Some very tough decisions are being made at this time.