I created a blog article on this some years back and wanted to create a video for this. I use the same method for other programs such as blender that allow you to program your own scripted tasks. Hope this helps you get on your way to create your own scripts.
https://www.yanesdesigns.com/blog/2016/04/cad-scripting-for-draftsight-users-lisp-alternative/
My coding skills are extremely basic so please excuse any bad coding practices.
Setting torque at 2500 ft lbs in flushing New York.