An alternative load the changed code then type (attnum "WIRE#") on command line, then can be used for any tagname. You can also do a simple defun that loads the code.
Change the 2 lines
(defun attnum (tag / ent enx num )
(if (/= "" tag)
Add at top of code, or any other tag names you want just make more defuns.
(defun c:wire ()
(if (not attnum)(load "attnum"))
(attnum "WIRE#")
)