Wikipedia.

Vietnam invaded Cambodia the same day. Coincidence??

The folklore I heard was that the invasion had something to do with the things you cite (Iran, friendly client on the border), but it had more to do with the Brezhnev Doctrine:

As a direct result of the so-called ‘Brezhnev doctrine’, the USSR asserted its “right and duty” to go to war in foreign countries “if and when an existing socialist regime was threatened.”[5] This accounts for the increased overseas military, political, and economic support being given at this time to pro-Marxist régimes in Nicaragua, Angola, Ethiopia, Mozambique, Yemen, etc. Such expeditions were in line with the twin geopolitical objectives of the Soviet Union. The first Soviet policy consisted of preparing the Red Army for a potential conventional and, probably, nuclear confrontation with the US. Secondly, Moscow pledged to continue supporting “wars of national liberation” abroad.[6] The latter resulted in what some analysts cleverly called the Third World War.[7] It would be decisively challenged in the deserts and mountains of Afghanistan.


IOW, it's complicated. ;-)

That's my story, YMMV.

Cheers,
Scott.
(Who thinks coincidences are quite common, actually.)