Didn't they barely force out a draw with Iraq which had less than half of Iran's population? Pakistan would be Iraq times 4 with a more experienced military and a better air force.
The only chance I see for Iran here is if India stepped in to stop the Pakistanis.
Most of the problems that Iran had during the Iran/Iraq war came down to inability to support more then light infantry from their own resources, and international resources not being available to them. Their heavy weapons were internationally sourced and could not be replaced where as the Iraqis had the US and USSR lining up to sell them new stuff. If Pakistan jumps into that war... well suddenly its a whole new ball game. Even if India doesn't get involved, which is highly unlikely, then the Indians are going to be more then willing to sell the Iranians as many tanks, guns, and planes as they want which radically changes the dimensions of the war. Given how successful the IAF was with the F-5, they probably would have been just as successful with the Ajeet. Given that its a light fighter which can be manufactured in India, and sold to the IAF cheaply... hello changes in the air war. Admittedly i'm not as up on the armor and artillery that the Indians could have provided, but i presume that it would have been better then what the Iranians were getting at the time.
That said... things are going to get very interesting very fast as the whole situation spirals out of control with the Indians and Pakistanis...