help micro elevator code

You are testing (all?) the combinations between the target floor and the current floor. I suggest you write code that calculates the current floor based on val1..4 values. Then you can just look at the difference between where you are and where you want to be.

Like:

if val1 == HIGH
currFloor = 1
etc.

distance = currFloor - targetFloor;

if distance == 0
stop
else
set motor direction based on the sign of distance
move motor of (stepsPerFloor * abs(distance)) steps
endif