vec_for_screen is used to convert screen coordinates into world coordinates. However, as view entities are located neither in sceen space nor in world space but in view space, vec_for_screen alone is not enough: Before using vec_for_screen you have to use rel_to_screen to convert the view entity's coordinates into screen coordinates.
So just add a rel_to_sceen to Walori's code. This should do the trick.