the commands "tpsetup" and "tpconfig" are for interactive use, not for scripts. You can use the cups "lpadmin" command also to add TurboPrint printers.
Maybe I can point you in the correct direction if I know more about your intention - why do you want to add a new printer in a script?
I want to create a script to setup all things (printer, desktop, softwares, ...) in my computer after the installation of my Ubuntu. So I put in my script :
- the installation of turboprint
- the use of tpsetup to add the key
- use sed to configure the file /etc/turboprint/system.cfg