I don't know of any GBS->MIDI programs. I had an idea to convert the music to an NSF since the music formats used by Spanky's Quest and Shatterhand are nearly identical.
So, I took the song data for the ending music in Spanky's Quest, replaced the first track in the Shatterhand NSF with it, and manually converted the absolute addresses used by the looping bytecode ($F5 ll hh) in the music data.
Unfortunately, the NES triangle channel and the GB wave channel are not exactly compatible within the format (the NES triangle channel notes come up way too short). Manually trying to lengthen it added an annoying delay at the beginning so I just kept it as is.
Also, the nsf comes to an abrupt stutter at about the 1:20 mark. Perhaps another incompatibility between the formats, or more likely that I made a mistake in the conversion.
Anyway, here's the result:
http://h1.ripway.com/kingshriek/sq_ending.zip
You'd be able to get a partial MIDI from this with a NSF->MIDI conversion tool. However, I'd guess there's probably a better option out there.