MHUPP beat me to it, in LISP a command has to be between brackets ( ) - your loop failed because getstring didn't have brackets, and so was expecting to insert the contents of a variable getstring... which doesn't exist.
I also changed this line to offset the text (a copy of the last line really - which you should be able to spot what to do to correct that too).
The next little thing that LISPs confused me is the IF statement, if you have more than 1 statement to work on for that condition you need to put that inside '(progn .... ) lke below - should be obvious where to put this in
(repeat MySeg
(command "_.rectang" MyPt (mapcar '+ (list MyW MyH 0) MyPt))
(if (= (rem acount 2) 0) ;; if, then the condition in between bracket. rem: remainder, 2 divided acount by 2
(progn ;;I am doing 2 things with an even number
(if (= color 0) (command "_.clayer" "Hatch1") (command "_.clayer" "Hatch2")) ;statement 1
(command "-hatch" "S" (entlast) "" "") ; statement 2
) ; end progn
() ; left this in here, the 'else' though it isn't needed. If else has several statments it needs progn like above
) ; end if
(command "_.text" "J" "L" (mapcar '+ MyPt (list (+ MyW 2) 0 0)) "" "" (getstring) )
and so back to the discussion about speed, entmake, and commands