I've done this by using an AND gate and basically switch off the STEP signal when a switch is triggered. Now you also have to use another AND port to allow the STEP to go through again when the DIR signal is reversed, so at least you can always move back out of the triggered switch.
That was a safety backup - in case the code didn't catch the end stop for whatever reason while the stepper continued to run.
The basic solution to your problem is as given in #2. Take one step, test condition. Take another step, test condition. Until the condition is met (switch triggered). Your stepper library may be taking a lot of steps before returning, not allowing you to check in between.
Another thing: I notice you have numbered variables (inputPin0, inputPin1, ...). You should look into using arrays for those things, it can make your life a lot easier and your code simpler and easier to maintain.