Tip: Switch palace switches normally disappear if you replay the level. However, if you insert them as direct Map16 and use the hex-edit at $00EEB2 in the ROM map, you can replay the level without a problem.
In a layer 2 level with the 2nd buoyancy option checked(disables all other sprite interaction with layer 2), sprites still interact with layer 2 'water' tiles regardless of whether you want or not. Its calculation cost is often the cause of slowdown in non SA-1 ROMs.
This patch makes non SA-1 ROMs completely skip the layer 2 interaction to enhance the performance when the 2nd buoyancy option is checked. It's expected to allow you to have 1-2 more sprites on screen without causing slowdown in FastROM.
The other (side)effect is to disable the interaction with layer 2 water(like other layer2 tiles), which would often be desired for consistency.
Note that for the speedup purpose, most importantly, you will always want to check the FastROM option too.
I replaced the if check to an assertion. After bringing if this was needed in staff, this may become a standard for future patches.
Good patch nonetheless; I personally never had the second buoyancy option with layer 2 water, but I'm pretty sure JUMPers other people might have, thus encountering this flaw.