It's a Lisp routine, so you can't call it with command.
This is janky, but it will work...
(defun c:Test (/ num)
(and (setq ss (ssget "_:L"))
(setq num (getint "\nNumber: "))
(vla-sendcommand
(vla-get-activedocument (vlax-get-acad-object))
(strcat "(r-array) 1 1 "
(vl-princ-to-string num)
" 500 "
) ;_ strcat
) ;_ vla-sendcommand
) ;_ and
(princ)
) ;_ defun
You might want to add a (load "3darray.lsp" nil)