Moving stepper motor to initial postion and diagonal

It would seem more logical to me to put the call to initialPosition() in setup() - presumably you only need that to happen once.

This style seems illogical to me

void stepsx (){
  digitalWrite (xsteps, HIGH);
  delay(1);
  digitalWrite (xsteps, LOW);
}

If you imagine that function being called repeatedly you have an interval that defines the length of the pulse but you have nothing that represents the interval between steps. Also the pulse width can be much narrower - 10 microsecs should be enough.

If this was my code it would look like this

void stepsx (){
  digitalWrite (xsteps, HIGH);
  delayMicroseconds(10);
  digitalWrite (xsteps, LOW);
  delay(intervalBetweenSteps);
}

and the value of intervalBetweenSteps could be set to define the speed you want the motor to move at.

Alternatively, omit the line delay(intervalBetweenSteps); from the function and includ it in the code that calls the function - something like

for (n = 0; n < numberOfSteps; n++) {
   stepsx();
   delay(intervalBetweenSteps);
}

However all of that use of delay() is probably not appropriate at all as the Arduino is blocked from doing anything else during a delay(). Have a look at the second example in this Simple Stepper Code which uses micros() and millis() for non-blocking timing.

That's probably enough for now.

...R
Stepper Motor Basics