A much more probable scenario: Tehran would use the attack to invoke Article 10 of the Nuclear Non-Proliferation Treaty (NPT) and withdraw from the treaty altogether. This article gives each party the right to withdraw if it decides that extraordinary events "have jeopardized the supreme interests of its country." Iran would cease all cooperation with the International Atomic Energy Agency, expel all UN inspectors, and by that, deprive the international community of much-needed transparency and insight.
More ominously, the attack could prompt the Iranian leadership to make the crucial decision to seek an actual nuclear bomb and not just the capability to build one, while accentuating Iran's role as a power against the status quo.
Consequently, a successful bombing campaign by either the US or Israel would simply guarantee a nuclear armed and vengeful Iran five years down the road. Mohamed ElBaradei, the head of the IAEA, said recently that if Iran left the NPT, it could build a nuclear weapon within a year.
To make matters worse, any military attack would reduce rather than increase the likelihood of a democratic takeover. As unpopular as the Iranian government is, the expectation that a secular democratic government would emerge in the aftermath of a bombing campaign is wildly optimistic and reminiscent of the Bush administration's miscalculations going into Iraq. War with Iran would be the death knell and not the savior of the Iranian democracy movement.