Turning a Stepper motor until an input detected and then turning the other way

From reading your code it is unclear what you want to happen.

After it gets out of the while loop, value won't be <100 anymore and your goto won't do anything.

Maybe take a look at:

...and break homing() up into homeTowardsACertainForce() and backOffFromCertainForce().