First get rid of the arg1, arg2, etc variables, as they are going the way of the dodo in WotLK.
Second, check for spellid, then return (in your message) the spell name as presented in the combat log, which would be localized. As to how to check for the id, create a local table at the top of your lua with all ranks of Devour Magic. Only this table will need updated with future ranks.
Code:
local DMID = { [id1] = true,
[id2] = true,
[id3] = true,
etc. }
Then to check the id in your function
Code:
if DMID[spellID] then
do stuff
end