Glad to see that you want to learn lisp. The learning part of the process got a bit short circuited with the solutions just plopped in. I was hoping to have an evolving dialog. You've got a complete solution with looping. If you're interested, consider this approach too. I would suggest you start with the legacy methods and then move on to activex methods. This solution is focussed on just changing one string. You've already got the loop.
;;split a text at a given pattern.
;;select a string object (no type checking here)
(setq e (car(entsel)))
(setq ei (entget e))
;;text value of string
(setq str (cdr(assoc 1 ei)))
;;string to split before
(setq pat "SHOP")
(setq loc (vl-string-search pat str))
(setq slist(list (substr str 1 loc)(substr str (1+ loc))))
;;Note: textbox ignores spaces and ignores rotation
;;Get the rotated textbox for the text string before changes
(setq ext (rotptlst (textbox ei)(cdr(assoc 50 ei))))
;modify first entity to hold first part of text
(setq ei (entmod (subst (cons 1 (car slist)) (assoc 1 ei) ei)))
;;when using command methods to move and copy toggle osmode off
(setq osm (getvar "osmode"))
(setvar "osmode" 0)
;;make a copy of the entity keeping the layer, style, location etc.
(command "copy" e "" '(0 0)"")
;;save the last entity
(setq e2 (entlast))
;;entity 2 info
(setq ei2 (entget e2))
;;change ei2's text content to second part
(setq ei2 (entmod (subst (cons 1 (cadr slist)) (assoc 1 ei2) ei2)))
;;get a textbox rotated to text rotation
(setq ext2 (rotptlst(textbox ei2)(cdr(assoc 50 ei))))
;;move the 2nd text string to align to where the orginal text string ended
;;Trans accomodates changed coordinate systems
(command "move" e2 "" (trans(cadr ext2) e2 1)(trans (cadr ext) e2 1))
;;restore settings
(setvar "osmode" osm)
;;Rotates points counterclockwise positive about origin
(defun rotptlst (lst ang)
(setq ang (- ang))
(mapcar '(lambda (pt)
(list (+ (* (car pt)(cos ang))(* (cadr pt)(sin ang)))
(+ (* (car pt)(-(sin ang)))(* (cadr pt)(cos ang)))))
lst))
This solution above is intended to be tested in vlide. Double click at the end of each line and load selected. After each step, use the vlide console to verify the contents of the variables set in that line. Good lisping.
Architect, Registered NC, VA, SC, & GA.