Trouble with Robot

CoolBot:
Why doesn't the arduino run the proper sketch with a 9v via the vin port?

You can't run motors off of a 9V battery so don't waste your time/batteries!
Use a big Lead Acid or NiMH battery pack. Its also very much suggested that you set up two power supplies (split supply) one for the Arduino and one for the motors. 99% of 'weird motor problems' are due to noise on the power line from sharing power supplies and/or not having a powerful enough supply! Even small DC motors can draw up to 3 Amps when they stall.