I'm not sure func_beam would do that... I was looking originally at hud.shader (/textures/hud/allies_headicon) but lack the understanding of how that is controlled.
I am looking at the code in jims punishment mod (hitme, crush, etc.) where I know an object is attached.... that may help....
Take a look at mefys capture the flag mod which is included in his extended game type mod (ftag). The flags in that mod are attached the follow the player around