Why use the alias. I would recommend using the document ID which will always be unique. But if you want to use the alias it is better to use the documentObject rather than the documentListing function:
if ($modx->documentObject['alias'] == 'page1') {
return '<div id="subnav"><ul><li>Link 1</li><li>Link 2</li></ul></div>
}
Or use the id:
if ($modx->documentIdentifier == 2) {
return '<div id="subnav"><ul><li>Link 1</li><li>Link 2</li></ul></div>
}
Notice I used return rather than echo, in this case it will not make much difference but it is a good practice to use return in snippets since it will work with every case.