close - you're getting there. A couple of little changes then
You have (setq SelObjs (ssadd)) twice in the example, it doesn't affect anything just adds clutter to the code
(command "Line"..... creates 8 separate lines as you would do using the command in AutoCAD.
You next line (ssadfd (entlast) SelObjs) adds the last entity created to the selection set - the line P8 to P1 (and not the whole lot)
The simple fix to understand and get working would be to write a line for each segment of the lines and add these to the selection set:
(command "line" p1 p2 "")
(ssadd (entlast) SelObjs)
(command "line" p2 p3 "")
(ssadd (entlast) SelObjs)
(command "line" p3 p4"")
(ssadd (entlast) SelObjs)
.....and so on
That makes the code a bit longer and less efficient (in the scale if milliseconds and not 'get a coffee' inefficiency
Another way would be to set a marker (setq latestent (entlast)) for example, create the lines as above and then loop forward from the latestent entity adding them to the selection set MHUPP gave an answer earlier today showing this method if you want to look at that
A quick correction to the chprop line:
(command "_.chprop" SelObjs "" "LA" "slab" "") ; set into layer.
You had SelObjs as "SelObjs" .Within " " it is seen as text, and outside " " it is seen as a variable - you want to use a variable here. then of course, add an 'enter' to stop the selections with "", also the same to end the chprop command
and so on...
Similar things with Hatch, go through it in the command line, type in -hatch and follow the prompts, copying exactly what you type into the LISP line for the hatch and you should get there... but so close!!