Code:

;Map HP12whse Printer
$SystemList = 'terminalserver','testserver','dbserver3','printserver' ;<--- there was an extra ," at the end of this line
If AScan ($SystemList, @WKSTA) = -1 ;<--- changed this line to check for ascan returning a -1, not in array, making the IF TRUE
IF INGROUP("HP12whse")
If AddPrinterConnection ("\\printserver\HP12whse") = 0
? "Attach network printer \\printserver\HP12whse"
Endif
endif ;<--- you were missing an ENDIF
EndIf