I have improved on the code but its not quite there, see below.
Code:
(defun c:updateblock ("SNP-00A1AH00PW" / ss)
(setq ss (ssget "_X" '((0 . "INSERT") (2 . "SNP-00A1AH00PW"))))
(if ss
(progn
(setq i 0)
(while (< i (sslength ss))
(setq ent (ssname ss i))
(setq atts (entget ent))
(foreach att atts
(if (= "ATTRIB" (cdr (assoc 0 att)))
(progn
; Update attribute values here
; For example, to update the value of an attribute named "TITLE1" to "20"
; Replace "TITLE1" and "20" with your desired values
(cond ((= "TITLE1" (cdr (assoc 2 att)))
(setq att-value "999")
(entmod (subst (cons 1 att-value) (assoc 1 att) atts)))
((= "TITLE2" (cdr (assoc 2 att)))
(setq att-value "1.0")
(entmod (subst (cons 1 att-value) (assoc 1 att) atts)))
)
)
)
)
(setq i (+ i 1))
)
)
)
)