I have a vague understanding of the background leading up to the war, and a fairly decent idea of the conduct of the war itself (I'm a nearly graduated Middle Eastern Studies student and my time at Defense Language Institute learning Arabic included a number of papers on the Iran-Iraq War), but some of my most recent reading (Guardians of the Revolution by Ray Takeyh) seems to imply that the Khomeini was intentionally provoking Saddam and trying to get a reaction out of him that would give casus belli for spreading Islamic revolution. I understand the whole dynamic of Iraq being 60+% Shi'a under Sunni rule during Saddam's reign, but if Iran thought they needed to spread their version of Islam into Iraq why didn't they just declare war? I'm a terrible International Relations student.
Iran was never out to spread the revolution by war, and at the time Iraq attacked Iran, Iran was still in the middle of the revolution and barely anyone was "in charge" yet.
Takyeh has his own biases. Amongst the exile anti-regime crowd, the idea that Iran or the regime was somehow at fault for the war, is a common meme.
One such meme is that Iran somehow started the war -- this goes to funny extremes in some history books which make total bullshit claims about the start of the war, for example one quite well-known historian claimed the war started because Iran had (under the Shah) taken over the entire Shat-al Arab, leaving Saddam "no choice" but to attack in order to be able to get access to the waterway, when in fact the river had always been divided down the middle since before the 1979 Islamic Revolution.
The other meme is that Iran needlessly dragged on the war when it could have ended it by accepting the cease-fire with Iraq, but instead pressed on and tried to topple Saddam. Hindsight is 20/20. Of course, this overlooks the fact that Iran quite legitmately considered Saddam to be a continuing threat (vindicated by subsequent history) and had Iran not pressed to topple his regime but instead Saddam was given a chance to regroup and possible re-attack, the same complainers would be complaining about whey Iran didn't try to remove Saddam back then when it had a chance.