You can't make this shit up. Nobody would ever believe it. It's too clownish.
This is standard diplomacy. Nations have a sense of honour, and they find it very difficult to accept the humiliation of being struck without reprisal.
In this case, Iran does not want escalation (quite the opposite) but they need to be able to do something to show they didn't just get slapped and do nothing. Therefore, Iran arranges a return strike, ensuring that this is not too deadly or damaging, and the USA magnanimously permits this to draw a line under the affair. The USA leaves happy because it got the better of the exchange, and Iran leaves... not happy exactly, but accepting, because it can say it stood up for itself.
Apparently Iran contacted the USA in advance. The message will have been something like "The missiles arrive at 2pm [so you've got 3 hours to make sure that anything essential you couldn't forgive getting destroyed is safe in a bunker]". Everyone will have known what the score was.