Indeed, if the block has attributes, (entmod) becomes more complicated: it requires going through transformation matrices and applying them to the attributes.
The move command would be simpler...
Here is the mhupp code adapted for proper operation: Merits to Mhupp for his code
;;----------------------------------------------------------------------------;;
;; Modify Text or Blocks to align Horozontal or Vertical
;; https://www.cadtutor.net/forum/topic/99091-i-need-a-lisp-to-align-blocks-and-texts-vertically/
(defun C:ATB () (C:AlignTextBlock))
(defun C:AlignTextBlock (/ vars vals pt1 pt2 vector mode ent ed pt newpt)
(vl-load-com)
(setq vars '(OSMODE ORTHOMODE)
vals (mapcar 'getvar vars)
)
(mapcar 'setvar vars '(0 1))
(setq pt1 (getpoint "\nAlignment Point: "))
(setq pt2 (getpoint pt1 "\nSelect Horozontal or Vertical:"))
(setq vector (mapcar '- pt2 pt1))
(if (eq (car Vector) 0.0) (setq mode 'V) (setq mode 'H))
(while (setq ss (ssget '((0 . "TEXT,INSERT"))))
(foreach ent (vl-remove-if 'listp (mapcar 'cadr (ssnamex SS)))
(setq ed (entget ent)
pt (cdr (assoc 10 ed))
newpt (if (eq mode 'V) (list (car pt1) (cadr pt) (caddr pt)) (list (car pt) (cadr pt1) (caddr pt)))
)
(vla-Move (vlax-ename->vla-object ent) (vlax-3d-point pt) (vlax-3d-point newpt))
; (if (or (not (assoc 11 ed)) (eq (cdr (assoc 11 ed)) '(0.0 0.0 0.0))) ;test if 11 doesnt exist or is 0,0,0
; (setq ed (subst (cons 10 newpt) (assoc 10 ed) ed))
; (setq ed (subst (cons 11 newpt) (assoc 11 ed) ed))
; )
; (entmod ed)
)
)
(mapcar 'setvar vars vals)
(princ)
)
(princ "\nAlignTextBlock Lisp Loaded")
(princ "\nType ATB or AlignTextBlock to run command")