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.
This table determines how a certain tile should vary its animation. 00 = always the same, 01 = change depending on $14AD, $14AE, or $14AF (P-switch timers and on/off switch), 02 = change depending on $1931 (FG/BG tileset number). It is indexed by the animation frame times 3, or (($14 & #$07) * 3), and each of the 8 possible animation frames uses one group of 3 bytes. Note that the last 6 bytes overlap with the table at $05B97D.