Gorbetschaw and the looming Russian bankruptcy/failure of communist isolationism were great for diplomacy.
I give Reagan a fair amount of partial and cautious credit for Soviet Union's collapse.
The Soviets had indeed dug their own hole, they were broke, military hardware was woefully outclassed by the current U.S. wares of the time, and in an even worse state of combat readiness. Many military personnel weren't even getting paid... the paltry amount they earned. That didn't much matter since food shortages and that of basic goods left little to spend it on.
Hundreds of millions of people were hungry, cold, and dancing on the razor's edge of Revolution 2.0, including those many military types who could launch the missiles, fly the jets, and drive the tanks. Shit had gotten very real indeed.
What Reagan did, was to keep his foot hard on the throttle and hands steady on the wheel in the most globally dangerous game of "chicken" in history. It was a bold and perhaps reckless game with lots of ways it could go very badly and only one way that didn't.
In the end, blind luck gets as much credit as Reagan. Gorby certainly seemed to be in pursuit of peace etc, but whether he actually had any real power where the rubber meets the road is highly questionable. The old school hardliners were always right there waiting to administer a "Heart Attack" if he got too ambitious.
It came down to three choices:
1. Maintain the status quo and risk an almost certain violent revolution.
2. Shoot first. Go to war with America to keep the people loyal to Mother Russia. Likely an attack based on typical rabble rousing Soviet Propaganda followed by state controlled media blowing their wad with total bullshit.
3. What eventually did happen.