What’s been made clear again the last couple of days, is that it is a priority for Iran to go through the proper diplomatic channels before resorting to military means. Even if it is likely to get them nowhere (I.e. holding off on retaliation for the promise of a ceasefire).
They want to convey that they are rational and principled when they commit to violence. They give a heads-up precisely because it won’t stop a retaliation. They don’t want an all-out war but they have to respond.
The primary audience doesn’t even have to be Israel and the US, but also the rest of the world: Iran is better because it has justice on it side. Iran holds itself to a higher standard and acts accordingly.
The resistance knows better than us what is at stake and what an all-out war would look like. Although it almost certainly wouldn’t entail less Palestinians dying.