I think the ShapeNameHud should basically do what you want. The control already walks the client object list, culls obstructed objects, positions text in relation to the object in 2d gui space, then scales the size and performs a fade-out based on distance.
At worst it would take some minor tweaking of the gui's C code to get it the way you want it. For example, the text does not currently rotate to match the object.
To get any shapeBase-derived object (pretty much everything with a 3d model) to display a name, the object must be assigned a shapeName using Object.setShapeName("name").
The full template will set the shapeName automatically for players - based on player name sent when connecting to the server (which defaults to "visitor"). It also sets the field for vehicles/turrets - based on a field "nameTag" defined in a vehicle/turret's datablock. At least in the 3.8 template ... I haven't played with the 3.9 one yet.
If those routines are bypassed or the name-popup functionality is desired for additional object types, it is necessary to call the setShapeName() function on the objects when they are added in script.