Another option, more respectful of the original format, could be to replace your Entmakex with this one.
(entmakex
(foreach as el
(setq l (if (setq v (cond ((= (setq c (car as)) 0) '(0 . "TEXT"))
((member c '(8 1 40 50 7 72)) as)
((= c 71) (cons c (cadr (assoc (cdr as) '((1 2) (2 1) (3 0) (4 0) (5 0))))))
((= c 73) '(73 . 2))
((member c '(10 11)) (cons c p2))
)
)
(append l (list v))
l
)
)
)
)