Shared() is executed once, and that's during frame initialization. A hack is to insert your function into the self.__elements table, which is executed every OnShow, and :UpdateAllElements().
Code:
local UpdateClassification = function(self)
local class = UnitClassification(self.unit)
if(class == 'elite' or class = 'rareelite' or class == 'worldboss') then
self:SetBackdropBorderColor(1,0.84,0,1)
else
self:SetBackdropBorderColor(1,1,1,1)
end
end
-- 8<8<8<8<8<8<8<
table.insert(self.__elements, UpdateClassification)
self:RegisterEvent('UNIT_CLASSIFICATION_CHANGED', UpdateClassification)
You'll want the event as well, to handle those elites turning normal and such.