II think we might be talking past each other here. I am not saying that Iraq after the toppling of the government wasn’t a shitstorm. It was and the same would be said for Iran. The point I am making is the leadership of Iran does not survive the war. They either die or best case just removed from power or go underground to fight in an insurgency likely dying down the road. The people of Iran suffer far more than the US will suffer in this situation. The question you need to ask did Iran learn anything from Iraq and my guess would be yes they did. Their leadership gains nothing by escalating this up to a 9/11 attack and again in the post 9/11 world I see that being a very hard thing to carry out.
Also, the US very well might have learned from Iraq. Who is to say the response to a 9/11 attack wouldn’t be to just use airstrikes and surgical strikes to cripple Iran's leadership, infrastructure and military. No need to fight them on the ground in Iran or occupy them. Of course, the government could be stupid and invade leading to Iran's government falling and a decade+ of insurgency. Which brings me back to my point that Iran isn’t that stupid and won’t escalate to that level. I don’t even see them escalating at all over this. They will do something but in the grand scheme, it won't be an escalation.