You've got your facts right... so, how long would it take to unblock a two mile wide shipping lane if Iran intentional sunk 30 or 40 ships there?
The Straights can’t be physically blocked, like you might do by sinking a ship in the locks of the Panama Canal.
The risk of being sunk is what would stop the traffic, either by mines, or by active fires, like ship to ship attacks, anti-ship missiles or artillery from shore, or air attacks.
Sinking 30-40 ships there would take a few days. Iran would only have a few hours.
The port at Bandar Abbas is vital to Iran's Navy and their commerce. If they blockade other people's shipping, they won't be getting their's either. It is like strapping on a suicide vest.