I've decided against displaying the angle / length inside the drawing space for now, although the code is still in Viewport.js, commented out under '// snap restriction info:' if someone wants to try it.
I had to try.
However, putting it in Viewport.js gave me an idea. Instead of just displaying the angle/length when the restrict tool is active, why not allow the information to be displayed whenever a coordinate is requested. I created a command 'DisplayDistanceAngle', which does not actually have a default command, but uses the F8 key to toggle the information on and off. Actually it toggles through the following sequence:-
Off -> Display distance and angle -> Display distance onhly -> Display angle only
then back to off.
I have attached the file 'DisplayDistanceAngle.zip', which contains a subdirectory 'DisplayDistanceAngle' which should put in 'scripts/View' directory. It also includes the altered file 'Viewport.js' which replaces the current one in 'scripts/Widgets/Viewport'.