excluding the issue of whether it is inefficient to create polylines with two nodes one by one as blocks
(if you simply want to name individual polylines, it is recommended to use xdata or hyperlinks).
To do what you want,
1. create a command with defun,
2. receive the value with (getreal) or (getint), and receive the name with (getstring).
3. You can create a polyline with (entmake).
In order to do entmake, there must be a dxf list required for entmake, and polyline information is included here.
To find out the value easily, you can create a polyline once and then "dump" it to see the code.
dump - https://www.cadtutor.net/forum/topic/74613-dxf-fields/?do=findComment&comment=590936
Not all dxf codes are required, but there are essential items for each entity.
http://docs.autodesk.com/ACD/2011/ENU/filesDXF/WS1a9193826455f5ff18cb41610ec0a2e719-79fc.htm
4. And to make this polyline into a block, you need to add entmake for blocks before and after the polyline entmake statement.
And since it is a block, it must be entered as insert to be created in the drawing.
5. To make it easier to specify the reference point, when creating a block, it is recommended to create the starting point based on 0,0.
6. If you want to insert without using command, you can use vla-insertblock.