Since the Islamic revolution of 1979, Iran has hated the United States. The end of the revolution wrought what was indeed a bad day for American flags in Tehran, as the American-backed government was fully overthrown. Iran's history from then is interesting, with their only significant war coming from the invasion of Hussein's Iraq in 1980. The war lasted 8 years, and Hussein's army inflicted 500,000+ casualties and USD 350 Billion in damage to the Iranians, in large part with mustard and nerve gas. The Iranians emerged from this war quite bitter, having felt teamed up against by just about everyone in the world. Iraq received weapons and support from many countries-- the highest number of weapons coming from France, China, and the Soviet Union. Even the United States provided political support and some helicopters (proving once and for all that the defeat of Iran seemed to be the only thing the Americans and Soviets could agree upon). Coming out of the war broken, but sovereign, the Iranians were rather pissed-- and bent on beefing up their military capabilities.
These days, the Iranians don't spend much on their own military, but still boast 550,000 troops, including the elite al-Quds. They have American F-14 Tomcats (provided before the revolution), as well as a large stock of Russian-provided weapons, and short-range ballistic missiles. But as the Iran-Iraq war showed us, Iran's home-field advantage would make it extremely difficult to invade. American forces' technological superiority would give them an advantage, but they're tied up with Iran's neighbors. And it's this tie-up that has given Iran the opportunity it needs to do something about being so angry at everyone all the time.
Not only is Iran angry about the United States' existence, but it is one of the few countries left in the world still trying to drive Israel into the sea (or, as it's written by President Ahmadinejad, "wipe Israel from the map." There's lots of good angry stuff at intelligence.org: http://www.intelligence.org.il/eng/sib/4_04/as_iran.htm). With the United States in Afghanistan and Iraq, (with alliances of sorts in Pakistan, Kuwait, and Saudi Arabia) Iran has been feeling a bit surrounded. Not only that, but the fundamentalist theocratic government has had an opportunity to quell a lot of old unrest by uniting its people against the Zionists and the Great Satan. Iran's reaction to the United States and Israel cramping its style has not been to cow, but to flex its muscles. And Iran's government is starting to realize it can really do whatever it wants.
On the list of Iran's diabolical plans for the Middle East:
1) Develop a nuclear weapons program. They're not fooling anyone. The wildly disparate UN Security Council continually agrees that Iran's "peaceful" nuclear power program covers a clandestine weapons program. It doesn't help that Iran's also developing "peaceful" medium range, nuclear-capable ballistic missiles. Having nuclear weapons would give Iran a leg up in its efforts in achieving objective number two...
2) Wipe Israel off the map. Nothing too new, but angrier than ever. President Ahmadinejad seems to have brought a whole new level to Iran's anti-Israeli hate. No real clashes yet... unless you count the unprovoked capture of soldiers and then rocket-bombing of civilians last summer by Iranian-trained, -funded, and -backed Hezbollah militants in southern Lebanon. But the consensus seems to be to blame Israel for that war anyway. Iran may not have driven Israel off the map with that effort, but Hezbollah emerged stronger than ever, and the Iranian government wouldn't be crazy to think that Israel lacks a great deal of political support these days, which might very well mean that Israel would think twice about a pre-emptive attack against a mobilizing Iranian army. Iran's strange alliance with Sunni-dominated Syria remains strong, perhaps only due to shared anti-Israeli sentiment. More strangely, this alliance hasn't been hampered by objective the third...
3) Win the war in Iraq and establish Shi'ite dominance in the region. Remember, Iran is a hard-line theocracy, and Sunni Muslims, while not as bad as Americans or Jews, still find a place on the hit list. Iran has clearly been funding the stronger Shi'ite militias in Iraq, hoping that they will triumph in the war and finally make Iraq a strong Iranian ally. The US invasion of Iraq has proved an opportunity for Iran to bring the only other large Shi'ite dominated country into its axis. If Iran can secure Iraq, it becomes a highly formidable force, and in time, could become an uncontested regional force. The US military and intelligence have found Iranian soldiers in Iraq, as well as evidence of their elite al-Quds infiltrating Baghdad and other hot spots.
And Iran hasn't stopped there. Until recently, they have kept to subversion and proxy fighting against the west. But now, they've taken another big step, and gotten aggressive. The capture and holding of 15 British troops has brought Iran into the war for real, as much as nobody really wants to admit it. This crisis puts Iran in a hugely advantageous position-- The Iranians understand that Britain values the lives of these 15 soldiers, and they now act as a powerful negotiating tool for the Iranians to get what they want. Britain, and the coalition in general, have been put in a very tough position.
Iran will continue its bold moves to take power in the region. It won't dismantle its nuclear program. It won't stop funding Hezbollah. It won't stop interfering in Iraq, and it won't give back British troops until it gets something very valuable in return. Iran feels emboldened, and invincible. This is mostly because no single group or alliance has both the will and the capability to invade. With the United States and Britain tied up in Afghanistan and Iraq, and their will for war depleting rapidly, Iran's two greatest enemies are all but out of the military picture. The next-largest militaries, France and Germany, surely won't consider invasion as a means for fixing Iran's behavior. Ever-confident that it can make move after move to shape the region as it wants, Iran knows that as long as none of its actions are too extreme, nobody will muster the will to do anything about it. This drip-by-drip escalation was mastered by Germany in the 1930's, and Iran may manage to stay far enough under the radar to see long-term success in its hopes for both an active nuclear weapons program and hegemonic dominance over the region.
But only if we decide to continue not to do anything about it.