In my view Reagan does deserve some credit, but actually for diametrically opposite reasons than many of those who worship at the altar of St. Reagan believe.
Reagan the war-hawk was a gift from heaven for the Soviets. A man whose loose rhetoric, willingness to spend on impractical but fearsome weapons systems and alarming foreign policy moves made foreign governments more willing to work with the Soviets (especially in Western Europe) and helped Soviet propaganda abroad and at home.
Contrary to popular belief, Reagan did not scare the Soviets into spending more on their military - the Soviets knew the US could outspend them, but they, unlike the US, had always known they were weaker so their fear did not increase. Reagan spending more on the military was just more of the same for a Soviet military planner. And while the Soviets were nervous that US technology could achieve what the majority of their own scientists assured them was impossible, the truth was that nothing Reagan could do could return the Cold War to the overwhelming superiority the US had enjoyed before 1970. Military technology meant that while the US continued to have the ability to obliterate the Soviets as a functional state and genocide the Soviet population, in the early 70s the Soviets gained the ability to do the same to the US.
We now know that the Soviets equivalent of Star Wars was not a reaction to Reagan's Star Wars - their research to space weapons had started in earnest in the mid 70s. Reagan's Star Wars pushed them to launch their Polyus battle station early but it did not result in much more funds aimed at Soviet space weapons programs. The Polyus was a kludged together test article that was mostly made out of spare parts left over from other programs.
All the things that really scared the Soviets - the Space Shuttle for example, or the US getting really serious about pushing human rights, were legacies of the Nixon era that Carter had continued and Reagan actually pulled back from. (EDIT: Actually, Ford may have started the US getting serious about human rights. Anyway, it was a big surprise to the Soviets when the US treated the Helsinki Accords seriously, and what the Soviets had at the time considered a diplomatic coup was instead used into a very effective stick to beat them with.)
As for Afghanistan, the US started destabilizing Afghanistan under Ford (yes, the US was messing Afghanistan up since before the Saur Revolution that brought the Communists to power), and Carter was the one who decided to fund the Mujahideen. Reagan here deserves at most gets credit for continuing the Nixon-Ford-Carter policies.
Rebuilding the US army after Vietnam mainly happened under Carter.
With deregulation, deregulation in the US started under Carter and most deregulation in fact happened under Carter and Clinton. While some particularly damaging deregulation happened to the US banking industry under Reagan, even worse would happen under Clinton and I think Reagan deserves neither the credit he gets from the right nor the blame he gets from the left. Reagan was simply following the consensus of previous and succeeding administrations by both US parties (and followed by many other parties abroad) in his own Reaganish way.
That Reaganish way is something that the left likes to minimize alot - but it had huge political effects. The guy was real gosh darned genial and a great salesman. After the damage that Nixon had done to US politics (damage that lingers to this day), and the foreign policy and economic disappointments of the 70s, under Nixon, Ford and Carter (first oil crisis, taking the US off gold, the fall of South Vietnam, fall of the Shah in Iran and Carter's malaise speech) Reagan's ability to sell optimism deserves respect.
So what did Reagan contribute?
See, Reagan was an optimist who really, really hated nuclear weapons and was scared to his marrow of nuclear war. So, when the USSR fell under the leadership of another optimist who hated nuclear weapons, Reagan was willing to ignore the US hardliners who said they could never trust the Soviets and that the best the US could hope for was a favourable balance of terror. He was willing to believe that Gorbachev was honest when he said he'd like to get rid of all nuclear weapons (Soviet leaders had claimed publicly for decades similar things) and tried to work with Gorbachev.
Reagan, the great optimist, sold the Soviet leadership on his optimism. And that really did help end the Cold War. Of course, neither Gorbachev nor Reagan was able to completely defeat their hard liners and both the US and Russia still have colossal stocks of nuclear weapons. But they did manage pave the road to significant cuts and the Soviet hope Reagan inspired did help convince them that there was a window to a future where they didn't need their empire in Eastern Europe and where instead of an adversary, the US could be a friend.
It may be that under a different president, the Soviets, even under Gorbachev would not have trusted that the US could be their friend and would have balanced internal reform with maintaining themselves as a competing power to the US, meaning they keep supporting their puppets in E. Europe, denuclearization doesn't proceed as far and either the USSR doesn't fall (though it would likely continue a relative decline), and the Cold War would continue to this day, the Eastern Block implodes violently or a close call as happened so often during the Cold War (Stanislav Petrov is only one of many people on the US and Soviet side who possibly avoided nuclear war - the Cold War was scary dangerous) actually results in a full nuclear exchange between the East and West.
So as false as St. Reagan is, the demon-prince Reagan is also a myth. We may owe him and Gorbachev our lives and our civilization.
fasquardon