You could possibly trying looking through the demoman SMA file, however that uses Entities wich may be bit advanced for earlier scripters, i mean personally i dont use entities cause its still too advanced for me

though if i spent a few days at it i could prolly grasp the concepts
Perhaps taking some of the demoman code and modifying the beam code so that you are the entity instead of teh mine might work... but there is prolly an easier way of doing it, but i dont know how