Get your facts right. It was not Pakistan who invaded Afghanistan, US did and after 7 years are still struggling to get it right.
True, we actually "invaded" Afghanistan in 1994 and after 7-years our proxies allowed the largest provocation in history against the sole superpower in 2001. Our "adventure" also led to a proliferation of armed jihadis and "talibans" all over our own country, suicide bombing sprees and a general bad name for Pakistan and Pakistanis all over the world.
We have some vital interests in neighboring lands, but playing games like superpowers is not within our capabilities.
US can cut and run and feel only minor reactions, but any price we will pay for our games will be major and consequential.