About that I don't know too much. But I do know that the Iranian revolution was, like the 1917 Russian revolution, a revolution of many different groups -- some antithetical to each other -- for instance there were liberals who allied with the Ayatollah to get a broad coalition against the Shah. And then the Ayatollah turned against them. The same thing happened with the Bolsheviks and during the Egyptian overthrow of Mubarak (lesson: never tie up with crazies, they'll cause more problems than what you are overthrowing)
Anyway, the Shah had a lot of people against him and would have fallen one way or the other I think (but I don't know). I think the Shah's position was more tenuous than Ghaddafis