The disabling of the HUD when it's off-screen should be your game code. Ideally you will want to have a root object that will do this, and this root object will have children, among which is your unit's health bar, any and all on-screen elements (such as Unit's name), and of course -- HUDText. This script will be enabling/disabling only children, leaving itself enabled at all times (otherwise it won't be able to re-enable itself after it gets disabled). This object will also have the UIFollowTarget script on it.
P.S. I'll add this in though, controlled by a boolean flag.