lets say that the Tudeh party or some other Stalinist party takes over Iran, and creates a Marxist-Leninist state
This requires a PoD back in the '50s at the very least.
In the '70s, Tudeh and the other leftist parties were pretty comprehensively wrecked. SAVAK oppression and (correct) perceptions of the far left as Soviet puppets had eroded the parties inside Iran, leaving only the diaspora element of the parties with any real strength.
After the Revolution, Tudeh saw something of a resurgence, as the Ayatollahs allowed it to operate more freely and it re-branded itself as a "loyal opposition" to the Islamist parties, however, at no point in the '80s did the regime allow Tudeh to grow too influential, and when the regime decided Tudeh was inconvenient, they rounded up the party within Iran and purged the lot of them.
An Iran in the Warsaw pact would be fascination to see in a tl, especially their relation with the Kurds and Iraq. How would the Soviet invasion of Afghanistan go if Iran was in their side?
Agreed, it is a fascinating idea. Unfortunately, when I looked into it myself, I could not see how to make it happen.
As for Afghanistan, if Iran is any flavor of socialist, even neutral and socialist, the invasion may not happen at all. The invasion happened because Brezhnev felt backed into a corner by expanding US influence in the region (consider, this was the time of US rapprochement with China, when the US-Pakistan alliance was strengthening, when Iran was a staunch US ally and when the Afghan government itself was making some very serious-looking overtures to the US - in hindsight we can see that the Soviets shot themselves in the foot, but at the time, they had themselves convinced that their entire southern border was going to fall to the fascist-imperialists).
lets say that a Maoist faction takes over the Iranian revolution
I wonder... One of the other reasons Tudeh struggled was it was a party of the urban working class - not a numerous group in pre-Revolution Iran. A Maoist party has the advantage that it is a leftist group that has no Soviet entanglements and is better adapted to appeal to the peasants. I could actually see such a group making real headway in Iran if something happened to discredit the Islamic clergy.
fasquardon