As Biscuits points out, the problem is most likely caused by an extra set of "", meaning an extra 'Enter', causing the last command to be repeated (hence, if the code is run on a new drawing, the Help is opened).
I've just hacked this together as an example, as I would recommend you use entmake to create your layer/insert - its much faster and less troublesome (you don't have to think about OSnap etc):
(if
(and
(not (tblsearch "BLOCK" "M-SPIDTABLE"))
(eq pmfolder "41")
(tblsearch "BLOCK" "TB-a1")
(setq block (findfile "P:\\ACAD\\wkspc\\BlockLib\\M-SPIDTABLE.dwg"))
(progn
(command "_.-insert" block) (command)
(tblsearch "BLOCK" "M-SPIDTABLE")
)
)
(progn
(prompt "\nM-SPIDTABLE table not found, inserting...\n")
(Layer "M-0900A-V-----------PrimaryProcessEquipments-DrwTxt" 210)
(Insert "M-SPIDTABLE" '(9.0 585.0 0.))
(command "_.zoom" "_extents")
(Alert "An Equipment table has been added")
(princ)
)
)
(defun Layer ( name colour )
(entmake
(list
(cons 0 "LAYER")
(cons 100 "AcDbSymbolTableRecord")
(cons 100 "AcDbLayerTableRecord")
(cons 2 name)
(cons 70 0)
(cons 62 colour)
)
)
)
(defun Insert ( name pt )
(entmakex
(list
(cons 0 "INSERT")
(cons 2 name)
(cons 10 pt)
)
)
)