The issue is going to be knowing when the backup has completed and the disk is safe to unmount.
tmutil startbackup will initiate a backup, but there is no estimation of time, nor a callback that gets called when it finishes.
Off hand, the only way I can see to do this is via a periodic loop, probably using something like tmutil latestbackup and checking the results to see when it's finished.
Conceptually:
diskutil mount E88AFD73-C7B2-372F-88EC-E09A779D072E
LAST_BACKUP = `tmutil latestbackup`
tmutil startbackup
while `tmutil latestbackup` == $LAST_BACKUP do
sleep 30
end
diskutil unmount E88AFD73-C7B2-372F-88EC-E09A779D072E
(note: this is not a valid shell script, just a conceptual outline of what to do - record the latest backup value, start the backup, and continually wait until the backup completes (because tmutil latestbackup no longer matches the stored value), then unmount the disk.