The Soviets wanted access to the Indian ocean and so did Afghanistan. They were also allied with India. It would have been a military invasion of Pakistan, that's why we stopped them inside Afghanistan for good.It wouldn't have mattered if the border had been sealed.
Did ISIS Syria effect Turkey?
They could have any policy they wanted, the border would have been sealed, no Afghan refugees in the country and AQ brainwashing would not have spread in KPK and FATA.
This entire TTP debacle happened because TTP and AQ were allowed to penetrate KPK and FATA and create sympathizers.
Why is there a Taliban school in Peshawar?
It's like Pakistan is proud of getting f**ked in the a*s for 20 years.
Also it's not that easy to just completely prevent Afghan refugees, there would have been massive parts of the population against it. A sizeable chunk of Afghans are the same ethnicity as the majority of Pakhtunkwa and we still largely believed in Muslim bhai-bhai, it wasn't until after people somewhat realised what the Afghans were like.
There just needs to be a strict crackdown and monitoring of current Afghan refugees, and seal the border with checkpoints.