You need to get rid of the G90 in the subroutine.
As it stands, you switch to incremental (G91) and move X, but then you switch back to absolute (G90) and ultimately move the X to an absolute position. So rather than every iteration of your sub moving incrementally in the X, you always end up moving to an absolute X position which means the next iteration will simply repeat the exact same movements.