There's a few points I want to make because I'm not sure all posters are aware of them.
1) The initial Iranian Revolution was not Islamic in nature. Khomeini hijacked the revolution to establish an Islamic state. Only a minority of Iranians wanted this in 1979. Khomeini was embraced as a symbol of resistance to the Shah, but he was in exile in Iran, and very few people were actually bothering to know what Khomeini was advocating. Khomeini was able to seize power by cunning and a series of fortuituous events - much like how Hitler or Castro seized power.
So if you want to avoid the Islamic Revolution, you should be clear whether your goal is to keep the Shah in power, or if you merely want to prevent Khomeini from gaining power. There is a scenario where the revolution happens, the Shah topples, but Khomeini does not gain control.
2) The 1950s CIA coup can be summarized as "Kermit Roosevelt spreads some money around to rent some mobs who act thuggish and say some bad things about Mossadegh so Mossadegh resigns." It's farcical. There was little resistance to the coup. Mossadegh didn't try to stay in power and crush the coup. Mossadegh had popularity, but the people against him were very widespread, and at the time the coup didn't seem to generate much resentment.
It was only much later int he 1970s as the new middle class was attempting to get political power that the Mossadegh era was seen as some kind of golden age where democracy was smashed by the evil CIA. It was primarily a myth.
Mossadegh was certainly a secularist who had said good things about democracy, and probably meant them. But his actions did not support his words. At the end of his term, he was ruling by decree and accumulating more and more power to himself. He was a charismatic demagogue, and was doing nothing to establish constitutional authority or the rule of law. We see this in many figures in history like Porforio Diaz in Mexico, leaders sympathetic to democracy, who accrue absolute power, neuter the legislature, and always seem to think that people are not ready for democracy.
Personally, I don't see Mossadegh as a real democratic figure, although I do see him as well-intentioned. He certainly wasn't a good leader and positioned Iran in a very dangerous position. Mossadegh made a good myth though, but that Iranians in the 1970s believed the myth was true doesn't make it so.
The latter is an interesting point, however let me ask this. Well, first, sources for what CIA did please.
But besides that, say Mossadegh becomes a dictator, would he have been as bad as the Shah? That's it.
For the first, wouldn't that result, ironically enough, possibly in a Communist, or Socialist revolution? I don't think there were exactly traditional liberals running around during it, so something to keep in mind.