Just write down what you do now manually, that is the basics of your lisp code. The steps have to be in lisp code format.
You can use Logfileon to record the manual steps, logfileoff to turn off logfile, the Log file is stored in your temporary directory path, look at Options, FIle, temporary path for location.
2 comments using vl-get-coordinates will get the co-ordinates of either a 2d or 3d poly it is a single list of all values you can then convert to a 2d or 3d list based on object type.
The other is if you say "put at vertice 2" it may put block at opposite end than what you thought was vertice 2 as the direction of the pline has not been considered, a solution is to select pline near an end for open plines you can then work out a pline direction.