Well, I tried :P Though UnitAffectingCombat should work. It's the same principle as my HP marker, if my deficit is more than 50% then the deficit will turn red (text). I have that in my updateHealth function.
I don't think I understand. Why would the update name function get called when the player entered combat? That is why it only works if he selects the frame: that act triggers an update name function call. I'm still learning Lua and the Blizz API, but my guess is that you need to register an event locally in your layout file that works off of the Regen Enabled/Disabled event. I.e. register the event on an Regen state change and have it call the update name function and have an If..Then determine if self has entered combat. Also the last few lines of the UnitAffectingCombat definition would negate using it IMO: you may get aggro but not return a true since you have not attacked or have been attacked yet.