This is what I ended up doing for my Mage Portal addon. It might not work for your use but thought I would put it out there to see if it works for you. I recall trying the one you did and it seemed to be intermittent in its use so tried this route and so far it hasn't failed me once I cached the results.
OnEvent Script function contents
Lua Code:
if event == "PLAYER_ENTERING_WORLD" then
for i,v in pairs(addonData.Spells) do
C_Spell.RequestLoadSpellData(i)
end
elseif event == "SPELL_DATA_LOAD_RESULT" then
local spellID,success = ...
if success and addonData.Spells[spellID] then
CacheSpellData(spellID)
end
end
In my case I have a preset list of spellID's I am interested in so I grab and store when the addon first loads but you can call that RequestLoadSpellData(spellID) function at any point and then watch for it and act according with the other event.
CacheSpellData is a function that stores the data i need to keep for the duration of the addon as for some reason it seems to disappear after a while. I guess the if you snooze you lose scenario.
Lua Code:
local function CacheSpellData(spellID)
addonData.SpellCache = {}
addonData.SpellCache[spellID] = {}
local id,fileID = GetSpellTexture(spellID)
local name = GetSpellInfo(spellID)
local isKnown = IsSpellKnown(spellID)
addonData.SpellCache[spellID].TextureID = fileID
addonData.SpellCache[spellID].Name = name
addonData.SpellCache[spellID].isKnown = isKnown
end