Basically, I think the most optimistic possible outcome from of this is returning to something like the nuclear deal, but with way better terms for Iran.
I don't see any realistic path for this fuck up to be unfucked. Aggressive foreign policy is seldom reversible, there is no way to get back to the previous save game.
The fundamental issue in dealing with Iranians was that they were strongly ideological and not very realpolitk - this is exactly what drove them into a conflict with US in the first place, a series of ruinous foreign policy moves - the hostages crisis, the Beirut bombing, proxy wars - that served no strategic long term purpose for Iran other than signaling ideological commitment within the regime.
So whatever you negotiated with Iran, you could only extract at gunpoint threatening their destruction (which even they understand is bad for their ideological goals), and you could never fully trust them to see their own-self interest and follow through. Their nuclear program was, in this context, more of a bargaining chip than an ideological regime goal, a way to put something on the table while maintaining their ideologically-mandated tools for power projection in the region, missiles and drones programs, various proxy fronts etc. This was a state of affairs that Israel was strongly opposed to, so they applied lobby pressure to kill the deal.
Well, having now actually attempted to destroy the regime and failed, whatever leverage you had for a non-nuclear Iran is gone. You have demonstrated to the Islamic republic that the only way to continue to exist is to obtain nuclear weapons, that no negotiated compromise can exist. You have also replaced the older, conservative, nuclear skeptic Ayatollah with his son, who's entire family was hit: father, wife, teenage son, sister and her toddler son and husband were all killed. Does he sound like a man who accepted to succeed his father's because he wants to correct the late Khamenei's mistakes and make a bid for peace?
The refreshed Islamic republic might sign various treaties or truces and accept nuclear deals, but they will surely break them because obtaining nukes has become existential. My expectation is that, if the regime does not collapse, either as a result of a ground invasion, internal uprising, or some combination (civil war etc.), then they will get nuclear weapons in the next decade. They are too easy to procure and the regime has now too little to lose.
No, Iran started helping the US against Taliban only to be put on the axis of evil list by Bush. Signed a deal with the US only to be torn and Trump placed maximum pressure.
US foreign policy in the Middle East is run by Israel.
Now the Iran theocracy saw full well that nukes are the only way they can stay alive. What exactly is the leverage against it?