The outcome in Iran was obvious to anyone paying attention. We knew Iran would close the strait, but we also haven't truly won a guerrilla war yet. Vietnam went poorly, Afghanistan went poorly, we've only historically done well in the more economically-defined traditional wars where there's an obvious target to fling a billion dollars worth of arms at.
Iran isn't stupid, they know there's not much point in building massive arms factories to make complicated weapons. The factories will just get bombed, and the weapons will probably still be inferior. They can just sort of stand there, though. We don't have the appetite for a boots on the ground invasion, and even then they can just kind of wait til we leave and go right back to it. We don't really have a winning hand here without resorting to war crimes, and the costs of that vastly outweigh any successes. We'd be international pariahs to a degree that I don't think most Americans realize is possible.
Nit: We have won a guerilla war, as the guerillas - the US Revolutionary War.
Arguably Iran's ability to manufacture pretty sophisticated weapons in relatively large quantities (and faster than the US) is one of the main reasons they won.