I have bad news for you....what you describe cannot be done legally these days.

The reason for this is that you end up switching the neutral wire, which violates the National Electric Code.

I concede that this arrangement was once common- but those were the days before polarised plugs, ground wires, PLC controls, and the like. I will admit that it worked extremely well- almost as if the lights "knew" which way you were walking.

Nevertheless, I think this is one clever electrical trick you don't need to know.