It seems that the proper way to update unit information is OnAttributeChanged handler. Something like
Lua Code:
function MyFrames_UnitTemplate_OnAttributeChanged(self, attributeName)
if attributeName == "unit" then
self.name:SetText(UnitName(self:GetAttribute("unit")))
end
end
seems to work for me (I didn't test it in combat yet). I guess I overcomplicated with those secure snippets, there's no use for them at all for my purposes.