clean up UnitFrame_Update hook

'this' is the frame that launched the event (a SecureUnitButtonTemplate derivative). SecureUnitButton always has a 'unit' attribute set which you can get by calling this:GetAttribute("unit"). Those two combined allow you to greatly simplify the code