While I'm on the subject, Sonic 3 does some other crazy ass stuff with regards to how it handles level data besides just being able to hotswap them outright.
Any time there's a chunk where you transition between indoors and outdoors and the level changes appearance (i.e. AIZ, FBZ, and LBZ), the game actually stores the level layout for those bits off the playable edge of the map and loads whichever one it needs when the player crosses a given boundary.
And there are a bunch of points where you're still technically on the same map, but the game has to unload a bunch of other data to make room for bosses/setpieces/etc. This is common in games to the point of being mundane when it comes to sprite data, but Sonic 3 does it with entire tilesets. Most notably, the ocean intro to AIZ Act 1 is completely separate from the rest of the act, MHZ Act 2's boss is elaborate enough that the entire level layout prior to the point of no return is unloaded (though object placement and the tileset itself remain), and the Death Egg art at the end of LBZ Act 2 is such a spectacle that the game has to throw out the tileset
and layout for the rest of the level to fit it in.
And then there's the usual trickery with changing palettes and vertical/horizontal looping, but that's not nearly so special.
I'm sure jman could elaborate more if you dragged him in here, but suffice it to say that the game's engine is a damn fine piece of work.
At least it isn't like Sonic Adventure 1 where you get the awesome final boss music at the start, then halfway through the fight it switches to bland generic boss music. I will never understand why they decided to do that.
My standard procedure for the 2004 PC version is to swap the two tracks. Much improved.
Running Open Your Heart over the Generations version works too.