The second byte's lower half, that you have highlighted in Blue, was found by JPAN to control which palette slot the palette was put into. This allowed for fixing the problems that come into play when two different OWs are using the same slot but different palettes. The most often example is the player's palette being changed to match the palette of another on screen OW because of this.
However, the upper half of the byte is a still a mystery.
So, if you made it XY, then X is the mystery and Y is the palette slot.
Have you learned anything more about this encryption you were researching?
Edit: Knizz has found a routine that uses the first byte in Y. He doesn't know what it does yet, but he has found something that uses it.