[[mySnippet? &action=`someAction` &tpl=`pmcTpl` &sortby=`name` &debug=`1`]]
<debug>
[[+pcm.someAction.debug]]
</debug>
if($this->properties['debug'] == 1 || $this->properties['debug'] === true){
$this->modx->toPlaceholder("pcm.$action.debug", str_replace('`','',$this->debug));
}
Snippet output here... ... ... <debug> Debug output here... ... ... </debug>
Debug output here... ... ... Snippet output here... ... ... <debug> </debug>
This question has been answered by BobRay. See the first response.

$this->debug = print_r($vars)
$this->debug = var_dump($vars)