Unofficial Response
I believe you are using the legacy Cortex/V4 system correct?
I believe that timing rotations is incredibly inconsistent. Instead, I believe you should use red shaft encoders or involve a limit switch. Until then I do not believe I can do anything to help you because at the moment right now i’d be playing a guessing game hoping that the code I help you with works when chances are there is a high probability it won’t using just time.
In order to run your motors a certain number of rotations you will need some kind of sensor that can measure rotations. As it is, your code starts the motors, waits 500 milliseconds , then runs the motors in the opposite direction for another 500 milliseconds. Because you are only controlling the voltage the motors receive, the number of rotations that a motor completes over a specific time period is highly variable, dependent on battery voltage, robot inertia, and your gear ratio. I’m not well versed on the legal parts for the BEST competition, but if legal I would recommend getting a set of optical encoders with which you can measure the number of rotations that your motors have completed.