Afghanistan would never become an SSR. Ever. I don't know where the rational for that came from.
However, if you truly wish to keep a communist government in power, all you have to do is stop the Soviet coup which initiated the Soviet invasion.
The Soviets were not happy with the Premier of Afghanistan at the time, Nur Muhammed Taraki, who was the leader of the more independent faction of the PDPA, the Khalaq faction. The Soviets were not at all happy with him in power, so, with Soviet assistance, Amin had him assassinated.
Edit: And the Soviets were on no way on a terminal decline. A decline, yes, but the collapse of the Soviet Union was in no way impending, or imminent. The collapse of the Soviet Union was an event which in reality was completely determined by a continued number of unlucky incidents.