I'm drawing health bars for my units by getting the model AABB and position in 3D space. I then use the y1 value of the AABB in replace of the y value in the position to make a new Vec3 object which I then pass to CameraUnproject. So in my case this should get me a2D point directly above the models head. I then move that point some pixels to the left and that's the X for my rectangle. This works pretty well but I would expect the rectangle to always look pretty much center over the head all the time. In the 2 pictures I've rotated on the left and right side and you can see the health bar sort of slides to one side or the other.
for k1,v1 in pairs(v) do
aabb = GetEntityAABB(v1.model)
pos = v1.model:GetPosition(1)
-- replace the y value with the height of the bounding box
pos.y = aabb.y1 + .25
result = CameraUnproject(camera, pos)
SetColor(COLOR_RED)
DrawRect(result.x - 25, result.y, 50, 5)
SetColor(COLOR_GREEN)
DrawRect(result.x - 25, result.y, 50, 5)
end