Back then, all the stans above Afghanistan were in the Soviet orbit.
The idea was to come through Pakistan and then use their navy to put people on the beach, supplied by the line they tried to forge and harden in Afghanistan (then Pakistan once they had established it). Pakistan, in the 80s was getting a lot of money and help from the Soviets, as they were not friendly with India.
Afghanistan was the issue. If they could get through it, they reasoned, they could probably take the Sauds.
‘their’ navy being the Soviet navy, not Pakistan’s.