Was the Russian invasion of Afghaniston externally generated foreign policy? Did this policy result in a bungled reform? (or imperial overstretch or defective system) Please explain.
I would say it was internally generated in that the Soviet aims were to prop up a foreign pro-Moscow govt, consistent with the Brezhnev doctrine. You can argue they were merely responding to external events, but ultimately this was a decision made in Moscow for Soviet political and geopolitical aims, and was no more externally generated than the US invasion of Iraq (which can also be argued was "externally generated" - as can any foreign policy decision, but ultimately both wars were wars of choice, not necessity).
The official Soviet line was always that they were there at the invitation of the Afghan government, and partly in response to foreign funding and support to the Afghan rebels (mujahedin). The reality is that the Soviets invaded to keep Afghanistan's pro-Soviet communist government in power. This was completely in keeping with official Soviet policy (see Brezhnev Doctrine) of not letting a pro-communist/socialist country slide out of the Soviet orbit. They actually killed the Afghan president during the initial stages of the ...
This solution is an overview of the Soviet reasons, official and actual, for their war in Afghanistan from 1979-1989. Mikhail Gorbachev's role and claims regarding the Soviet intervention are briefly discussed, as well as the idea that Soviet overreach in Afghanistan contributed to the USSR's ultimate collapse.