Calculate the correct current limit for driver A4988

Because in your first sketch you have only one delay per step, you must increase the delaytime to 1600 to achive the same result.
The two delays in your second approach lead to false step states which leads to the unreliable behaviour.