Thanks for the update Thorsten.
For those out there who want to see what a final solution looks like, remember to issue the "background_server_takeover" command at the start of each script.
Here here are my input scripts, which I call from a wrapper bash script:
snapstart1.txt
background_server_start backupsession
background_server_execute backupsession db_connect
exit
snapstart2.txt
background_server_takeover backupsession
background_server_get_reply backupsession
background_server_execute backupsession backup_start COMP_DATA_SNAP data
exit
snapstop1.txt
background_server_takeover backupsession
background_server_get_reply backupsession
background_server_execute backupsession backup_finish COMP_DATA_SNAP ExternalBackupID 60
snapstop2.txt
background_server_takeover backupsession
background_server_get_reply backupsession
background_server_exit backupsession
exit
I have a sed command in the wrapper script which increments the number of the ExternalBackupID each time, which is important so different numbers are stored in the backup history.