Not to nitpick, but I believe the Runes turnin's for Omens spells are in sequential order, specifically, and are not in fact random - since they are LORE/NO DROP and all, you cannot get the same one twice? Anyway, not sure if this would make the coding easier. If you already have spell_xx, do not give it again?
I don't remember far enough back to the SP/EP turnin's... but I think those were tradeable, so you could actually get the same one twice - which sucked!