I can start by running
sudo sh /home/pi/chdkptp/chdkptp-sample.sh -i -c -e"lua switch_mode_usb(1)"
but how do I add the other commands?
sudo sh /home/pi/chdkptp/chdkptp-sample.sh -i -c -e"lua switch_mode_usb(1)" -e"lua set_zoom(0)" etc etc
doesn't seem to work.
"doesn't seem to work" in what way?
You can use multiple -e commands from the command line. In that case, you don't need -i, which would leave it in interactive mode after the -e commands complete. The gui only tries to start if there are no command line options at all, if there's just -e commands it runs in batch mode, which executes all the -e commands and then exits. You also don't need dis, it will automatically close any open connections when it exits.
You can also make a file of chdkptp commands and run that with the 'source' cli command or the -r commandline option. see USAGE.TXT for more details.
You may have trouble doing switch_mode_usb and set_zoom too close together. The camera needs some time to actually switch modes, and may not be ready to move the zoom for some time after switch_mode_usb() finishes. You can use sys.sleep on the chdkptp side to force a delay, e.g.
exec sys.sleep(1000)
will wait one second.
Another problem you might have is that the 'lua' command does not wait for the script to finish on the camera, so may get an error that a script is already running. Use luar to wait for the script to complete on the camera. Or you could put all your camera commands in a single lua call, like
lua switch_mode_usb(1); set_zoom(0); shoot(); switch_mode_usb(0)
If you need delay between them, you can use sleep(<milliseconds>) in camera side lua.