Just a clarification (if I can) about your comment pertaining to "" instead of ;
In your routine you're mixing LISP functions with menu commands. And that's fine, a lot of folks do it that way. I don't, cuz' I'm not smart enough to keep track of where I am. I tend to use all one or the other.
In LISP, an ENTER in a command call is represented by dbl quotes ""
EX: (command "-layer" "m" "peanutbutter" "")
That last "" closes the layer command
In menu syntax, the semi-colon represents an ENTER
EX: 'layer;m;peanutbutter;;
notice the two semi-colons at the end, one to enter the layer name PEANUTBUTTER and the last to close the layer command
Me being a keyboard junkie from way back, I tend to make lisp functions for everything.