Homing 2 steppermotors with different steps

Doesn't it try with the stepperX.run()s inside the while()s?

Accelstepper has a built-in-example where you can abort a move early with controlled deceleration:

If you were going slow enough, you could stop at a predictable distance from where you triggered the switch. 3d printers sometimes have a multi-part process where they approach at higher speed, then back off and step slowly onto the switch.