A third function, simply named CastSpell, also contributes to spellcasts. It gets passed a number identifier that is dependent on the alphabetized order of spells in the spellbook (but the order is split across 4 talent categories), and the word "spell".
You can simplify this whole procedure, however. In WoW 2.0, Blizzard has added a new event called "UNIT_SPELLCAST_SENT". It's a dream come true. Consult Iriel's patch notes for details.
But really, I can't help but endorse my own library. Included in my AddOn, JIM's Cooldown Pulse, are 3 files (two SpellCast files and ItemUse) that gather information about spellcasts AND items. Spells seem to work flawlessly, items almost so. If you're interested in it, you can just pull the files out of the ZIP for your own project (JIM_toolbox subfolder):
http://www.wowinterface.com/download...php?s=&id=6192