Iran has done really well with missile technology, they have made all sort of different home made missiles and have made their country a fortress. Cutting edge technology in land to land missiles, navy missiles, land to air missiles, cruise missiles. Who would dare to mess with Iran.
But they are making a mistake by not upgrading their airforce. They should buy 500 4th generation Jf17 block 3s, get the transfer of technology from China and produce Iranian missiles, avionics etc for it, produce all parts in Iran and this way they will not be sanctioned during war (or if Russia is offering any jet with same conditions then go for it)
If west and allies attack with 5000 fighter jets then without a doubt Iranian air force will be defeated but the 500 planes will be a deterrent and they also will be backed by all the missiles, so this will make Iran more stronger.
Country like Pakistan has nuclear weapons, with powerful missile force but they are still finding different ways to be stronger, like airforce, ships, submarines. Somebody can say why waste billions on navy and airforce when your a nuclear power. The answer is they want to make their defence strong from all angles. If for example Pakistan is hurt really bad then they will still be able to destroy enemies through submarines which will be quietly hiding in the ocean with nukes.
Iran needs missiles on submarines, airforce, ships, underground. Try any means necessary to defend themselves, keep the enemies worried
.
When Iran shot missiles in to Iraq at Usa bases, all Iranian defences were on high alert for an American attack and they ended up shooting their own plane, if they had 500 planes in the air packed with missiles then the military generals would know Usa and allies will have to first deal with our air force before entering our airspace. The Iranian airforce would have been guarding the borders from the air with powerful missiles and the sea with powerful submarines/ships.