Interface with a front bumper switch and reverse?

My rover has two front bumber sensors, and I would like to have it reverse a bit and have it try and find a path around the obstacle when those are triggered.

Should I use a lua script or do you think I can cheat ardupilot into thinking those are rangefinding sensors and just set a few parameters (assuming I don’t have to reverse for now?).

Thank you!