I believe that Bacula script is a manual loader script that relies on an operator to load the tape and just notifies the operator to do so and then confirms it was done.
What you want is the actual mtx code. mtx is to libraries as mt is to the tape drive. You can find it here
SourceForge.net: MTX: Media Changer Tools. Then you can open a terminal session, and do things like
# mt status
# mtx -f /dev/scsi/changer/c2t0d0 status
# mtx -f /dev/scsi/changer/c2t0d0 unload 10 0
# mtx -f /dev/scsi/changer/c2t0d0 load 16 0
# mt status
The above would see that a tape is in the drive, show the contents of all drives and slots with their barcodes, unload the tape in drive 0 to slot 10, then load the tape in slot 16 to drive 0, and finally double check the status of the drive.
Both Amanda and Bacula use mt and mtx and then have their own scripts for tying into those.