CAB beat me to the punch but here's my version:
(defun CREATE_TEXTSTYLE (TxtSty hgt Wdth Font / Doc vltxt lst msg)
(vl-load-com)
(setq Doc (vla-get-activedocument (vlax-get-acad-object))
vltxt (vla-Add (vla-Get-Textstyles Doc) TxtSty)
lst (list (cons '"Height" Hgt)
(cons '"Width" Wdth)
(cons '"Fontfile" font)
)
msg (if (tblsearch "style" TxtSty)
(strcat "\nText Style '" TxtSty "' Updated....")
(strcat "\nText Style '" TxtSty "' Created....")
)
)
(mapcar '(lambda (x)
(if (vl-catch-all-apply
'vlax-put
(list
vltxt
(car x)
(cdr x)
)
)
(progn
(princ
(strcat "\nBad mojo detected in " (car x) " setting.")
)
(princ "\nText Style Creation Failed! \n")
(vl-catch-all-apply 'vla-delete (list vltxt))
(exit)
)
)
)
lst
)
(princ msg)
)