It is most definitely a defense if you use the same logic the US does. If the US can seize oil tankers going to and from Cuba and Venezuela and attack fishing boats in the name of national security, then Iran can definitely blockade the Strait of Hormuz in the name of defense.
You would not call the the US enforcing a blockade as a defensive tactic. It is offensive, as is what Iran is doing. Defensive would mean defending ships navigating the strait.
Bullets shot from guns can be defensive and offensive depending on who's pulling the trigger and why.
The straight is exactly the same. Iran is blocking the straight to pressure the world to pressure the US and Israel to stop their aggression. It's completely logical, reasonable, and is really a defense strategy.
The US blockading the straight is an offensive move to try and force Iran to... actually it's completely unclear what the US wants Iran to do. We just attacked them because of some imaginary threat cooked up by Israel.
No. The preservation was all done by the US attacking them. Everything on their part is just well motivated defense.