How to do Switch Reassignment?

I am just about to embark on automating my home. To begin, I would like to “correct” some odd switch placement. I have a hallway with two lights, and two switches, each switch controlling one of the lights. Unfortunately, each switch controls the wrong light.

My hope was to install two z-wave (or similar) switches, and the use HASS to simply swap the lights controlled by the switches. Unfortunately, it seems all switches first toggle the state of the attached load, and then notify (or are polled by) the software. I want a switch that first notifies the software and lets HASS decide what to do.

Is such a thing easily achievable? I imagine it could be made to work using two in-wall relays and two switches, with nothing attached to their load terminals, but that gets expensive very quickly. I don’t really care about the technology used (z-wave, ZigBee, whatever), but once this is in place I will be wanting to roll it out to my entire home.

Thanks for the help.