You also need to check the element still exists, to prevent potential debug errors:
function someFunction()
setElementData(source, "nametags.bubble", true)
setTimer(function(source) if isElement(source) then removeElementData(source, "nametags.bubble") end end, 7000, 1, source)
end