This exact situation actually happened all the time. The cutting room floor lists about 500, in various states between just a little accidental included code to most of it:
Thanks for the link. I hadn't previously visited that site. Very interesting.
From a quick check, I can't see this particular Space Quest II disk's AGI interpreter uncompiled code mentioned in there yet. Do you agree?
I have noticed that the same thing happened with a King's Quest III disk, in fact it looks like it may have happened around the same time as the Space Quest II occurrence.
This AGI code is mentioned at the bottom of the Space Quest II page. It's not technically "source code for the game" so it doesn't fit in the category I linked above.
https://tcrf.net/Category:Games_with_uncompiled_source_code