There are several applications like Blitz3D or other kinds of game construction tools that compile scripts or other game data to a single executable file. How do they do that?
Different tools approach that in different ways, but the way Blitz3D does it is to wrap the code and an interpreter into a bundle. Then when you run the exe, that launches the interpreter and passes in the bundled code. It's pretty much the same as how, say, Python works when using py2exe.
In many game development tools, the code that is bundled along with the executable is simply raw text that the interpreter parses. However some take a bytecode approach like Java, where the source-code is turned into an intermediate form that the virtual machine uses. I think Unity uses this latter approach but I'm not sure.
Off the top of my head all game development tools I can think of that package executables are either based on this approach of a core interpreter/virtual machine and then packaging it with the code, or are libraries that you compile in Visual Studio or whatever.