You can use virtually any sequencer (Cubase, Logic or their "small" brothers Cubasis and Logic Fun/Micrologic) as long as it is compatible with Mac. Cakewalk isn't!!!
Don't buy Cakewalk (..I never thought I'd ever say that..)
There's tons more cool software, but check if it's Mac compatible. Since you're talking about an iMac, also check if it's soundchip supports full-duplex (recording/playback at the same time), cause it probably doesn't have a dedicated soundcard. (I'm not sure if one would fit in anyway). Also surf the net for demo's and freeware. I myself like to read mags like 'Computer Music', which give indepth coverage of new software, and provide you with free software and/or demo's of them (Mac/PC).
Once you've found yourself a suitable sequencer, you can always add software you might need later. You don't have to buy it all at once.
Don't be afraid to buy the 'wrong' stuff, just ask around and read.
greets..