The problem with the original code was that you were using the vizact.onkeydown command incorrectly. It should be:
Code:
vizact.onkeydown( 'a', menuScene.visible,viz.ON)
vizact.onkeydown( 's', menuScene.visible,viz.OFF)
The second parameter to the command needs to be a function object. All other parameters will be passed to the function when the specified key is pressed.