Pakistan was just a middleman in the game of Superpowers.
The military leaders got their bagfuls of money and some shiny new toys while the country was screwed for a long time to come.
It has still not recovered from the after effects of the US proxy war.
Afghanistan was not even the major reason for USSR to break. They lost about 12000 soldiers in the war (when they were prepared to lose millions in a world war, having already done that in the previous one). The reasons were mainly economic and structural.
As a US biggies of the time Brzezinski mentioned:
What is most important to the history of the world? The Taliban or the collapse of the Soviet empire? Some stirred-up Muslims or the liberation of Central Europe and the end of the cold war?
They got their "liberation of Central Europe" leaving Pakistan (and other Muslim countries) to deal with "some stirred-up Muslims".
Of course, they miscalculated on that part and are now having to squash some of the stirred up folks in their caves, the point still remains.