$output .= '<li'> . $value . '</li>';
...
return $output;
is one way. You can also echo each line, but that sometimes has unexpected results; it can show up in odd places on the page.
You can use
heredoc syntax.
(wow, looking that reference up, I just discovered the unparsed "nowdoc"! )
You can also load the $output into the placeholders array with $modx->setPlaceholder(’placeholder-name’, $output) and then put the placeholder anywhere you want (as long as it is in the HTML after the snippet call).
This is MODx; there’s lots of ways to do just about anything!