It wasn't the delay. It was the library file for AFMotor.cpp. The enabling of the H bridges in AFStepper::AFStepper is followed by initialization of PWM, which disables the bridges. By copying the bridge enable lines, it works:
// enable both H bridges
pinMode(5, OUTPUT);
pinMode(6, OUTPUT);
digitalWrite(5, HIGH); // copy this line
digitalWrite(6, HIGH); // and this line
// use PWM for microstepping support
// use PWM for microstepping support
initPWM3(1);
initPWM4(1);
setPWM3(255);
setPWM4(255);
digitalWrite(5, HIGH); // paste this line
digitalWrite(6, HIGH); // and this line
This is 'duh' code. Why did it work in the IDE? I will post this find to the folks who wrote the library file...