Cannot figure out how to use Arduino MotorShield R3

I recently bought a motorshield, like this one: http://arduino.cc/en/Main/ArduinoMotorShieldR3

I cannot for the life of me figure out how to get this motor to turn a specified number of steps without going through and changing the polarity of each coil like this code does:
(typo is not mine)
/*************************************************************
Motor Shield Stepper Demo
by Randy Sarafan

For more information see:

*************************************************************/

int delaylegnth = 30;

void setup() {

//establish motor direction toggle pins
pinMode(12, OUTPUT); //CH A -- HIGH = forwards and LOW = backwards???
pinMode(13, OUTPUT); //CH B -- HIGH = forwards and LOW = backwards???

//establish motor brake pins
pinMode(9, OUTPUT); //brake (disable) CH A
pinMode(8, OUTPUT); //brake (disable) CH B

}

void loop(){

digitalWrite(9, LOW); //ENABLE CH A
digitalWrite(8, HIGH); //DISABLE CH B

digitalWrite(12, HIGH); //Sets direction of CH A
analogWrite(3, 1023); //Moves CH A

delay(delaylegnth);

digitalWrite(9, HIGH); //DISABLE CH A
digitalWrite(8, LOW); //ENABLE CH B

digitalWrite(13, LOW); //Sets direction of CH B
analogWrite(11, 1023); //Moves CH B

delay(delaylegnth);

digitalWrite(9, LOW); //ENABLE CH A
digitalWrite(8, HIGH); //DISABLE CH B

digitalWrite(12, LOW); //Sets direction of CH A
analogWrite(3, 1023); //Moves CH A

delay(delaylegnth);

digitalWrite(9, HIGH); //DISABLE CH A
digitalWrite(8, LOW); //ENABLE CH B

digitalWrite(13, HIGH); //Sets direction of CH B
analogWrite(11, 1023); //Moves CH B

delay(delaylegnth);

}

I am going to be creating a wire feed mechanism and need to be able to tell the stepper how many steps/revolutions to turn based on an input from a keypad. Basically I will be converting inches to the number of steps needed to pull the wire that number of inches through the feed roller. Will I need to create a for loop that repeats the steps until a counter is done?
I am new to the Arduino scene but am knowledgeable in electrical theory and basic programming concepts.
Any help would be greatly appreciated.
Thanks.

First always post code within code tags (the # icon).

analogWrite(3, 1023); //Moves CH A

this is incorrect and not what is in the examples , the second parameter has a range of 0-255 on the Arduinos.

Your real problem is to figure out how to make the stepper take one step in the direction you want and then keep repeating that for the number of steps you require!.

Mark

Your real problem is to figure out how to make the stepper take one step in the direction you want and then keep repeating that for the number of steps you require!.

Your real problem is that you are not using the Stepper library (assuming that the mysterious motor is a stepper).