The "command" function works by running Autocad commands in the current drawing session. The acad.lsp and acaddoc.lsp routines are run BEFORE the Autocad drawing session is initialized, so there is no Autocad session to run the Autocad command in. Therefore, "command" won't work.
When the drawing session finishes initializing, the first thing it does is run the "S::STARTUP" function. Therefore, if you want to do something at startup that uses the "command" function, you need to add it to this function.