I need a second pair of eyes.

I am helping a 81 year old friend in our robot club who has started robots as a hobby. His bot is using the arduino with a motor shield. I was able to get his motors to work with the bump switches, but I now need to add his ping sensor to the loop. Can someone look at this code and tell me if it will work? He lives across town and is able to load the program himself. What I need is a more experenced set of eyes to look at this and tell me what they think.

Thanks in advance !!!!
Mike

[quote] 
#include <AFMotor.h>

[color=#CC6600]AF_DCMotor[/color] motor1(1, MOTOR12_64KHZ); 
[color=#CC6600]AF_DCMotor[/color] motor2(2, MOTOR12_64KHZ);
const [color=#996600]int[/color] buttonPin = 2;
const [color=#996600]int[/color] pingPin = 7;
[color=#996600]int[/color] buttonState;

[color=#CC6600]void[/color] [color=#993300][b]setup[/b][/color]() {
  [color=#996600]Serial[/color].[color=#996600]begin[/color](9600);           
  [color=#996600]pinMode[/color](buttonPin, [color=#CC0000]INPUT[/color]);   
  motor1.[color=#996600]setSpeed[/color](200);         
  motor2.[color=#996600]setSpeed[/color](200);        
}

[color=#CC6600]void[/color] [color=#993300][b]loop[/b][/color]() 
{
  [color=#996600]long[/color] duration;
  [color=#996600]pinMode[/color](pingPin, [color=#CC0000]OUTPUT[/color]);
  [color=#996600]digitalWrite[/color](pingPin, [color=#CC0000]LOW[/color]);
  [color=#996600]delayMicroseconds[/color](2);
  [color=#996600]digitalWrite[/color](pingPin, [color=#CC0000]HIGH[/color]);
  [color=#996600]delayMicroseconds[/color](5);
  [color=#996600]digitalWrite[/color](pingPin, [color=#CC0000]LOW[/color]);
  [color=#996600]pinMode[/color](pingPin, [color=#CC0000]INPUT[/color]);
  duration = [color=#996600]pulseIn[/color](pingPin, [color=#CC0000]HIGH[/color]);

  [color=#996600]digitalWrite[/color](buttonPin, [color=#CC0000]HIGH[/color]);
  buttonState=[color=#996600]digitalRead[/color](buttonPin);
  
  [color=#CC6600]if[/color](buttonState == [color=#CC0000]LOW[/color] || duration < 800)
  {
    motor1.[color=#996600]run[/color]([color=#CC0000]BACKWARD[/color]);
    motor2.[color=#996600]run[/color]([color=#CC0000]BACKWARD[/color]);
    [color=#996600]delay[/color](1000);
    motor1.[color=#996600]run[/color]([color=#CC0000]FORWARD[/color]);
    motor2.[color=#996600]run[/color]([color=#CC0000]BACKWARD[/color]);
    [color=#996600]delay[/color](1000);
  }
  [color=#CC6600]else[/color]
  {
    motor1.[color=#996600]run[/color]([color=#CC0000]FORWARD[/color]);
    motor2.[color=#996600]run[/color]([color=#CC0000]FORWARD[/color]);
  }
}



[/quote]