Also, have you tried entering each line directly into the command line to see if you get the same error?
For instance:
Command: (command "layer" "f" "*keyplan|*patt-*" "")
This is what I got...
Command: (command "layer" "f" "*keyplan|*patt-*" "")
Unknown command "F". Press F1 for help.
Unknown command "*KEYPLAN|*PATT-*". Press F1 for help.
nil
Do you suppose the autocad utility is not being loaded..?? Like acaddoc.lsp, etc..??