Where do you have your RealTracks and Drums ?
are you using wma or wav ? wav files come with the Audiophile Edition.
If you right click on a media item > Source Properties it will tell you where the file is it's looking for.
Also Action > Peaks: Build any missing peaks
You can set in Preferences (Ctrl+P)
My RealTrack are here: d:\Music\BIAB\RealTracks\
My Drums are here: d:\Music\BIAB\Drums\
Your instructions don't mention anything about wav or wma files.
They just talk about SGU files, which is how BIAB saves my files.
Sorry but it seems you are assuming many things before your script will work properly.
Again, right now all I have to do is save my BIAB file.
Export each track (I choose .wav), and then in Reaper just drag these .wav files right into new tracks. BINGO!
Very simple. I mean how much simpler can you get than that?