dubb
Daron gives good advice.
You may think its too simple a problem to write the steps down but it's the best place to
start. I may not write the code down but I do it in my head for simple problems.
Here I'll get you started.
1 Change layer to S-BEAM, assume it exist for the time being
2 ask user to pick end point of line
3 as user to pick other end of line
You take it from here. How would you actually draw this?