The problem we have now is if the first tape job is still running, the second one's inventory and erase command gives the error 'Unable to perform Tape inventory for library HP MSL G3 Series 7.10: cannot lock tape drive' and skips past the commands straight onto the backup job (which runs once the first tape job is finished). Is there any way to pause the prescript until the drive is free?
-Wait only tells Powershell to wait for the command you attach the parameter to; it doesn't wait for other processes
That is, for your above script, -Wait would tell powershell (in plan language) "Don't do anything else in the script until this command completes."
What you will want to do is write a logic in your script to look for the alternate job and see if it's running. The $_.LatestState property can help likely with determining this, but it should be __stopped__ in most cases. If it's not, you might just assume it's still running.
If you want to be a bit more complex, you can try to write a "Try/Catch" statement for your script and write a handling to wait N minutes if the lock fails.