The guide says that you're supposed to double-click the list box and add code there, but yours appear to be working on a text box. I would double-check that you're working on the correct GUI control, I followed the same example in my game and to me the function looks like this
Code: ags
function lstSaveGames_OnSelectionChange(GUIControl *control)
{
txtSaveName.Text = lstSaveGames.Items[lstSaveGames.SelectedIndex];
}