commands: doCode: allow command to be an actual command element

(integrated from master branch change 5b68705 by Todd Whiteman <toddw@activestate.com>)