I’ll start some things off. Make sure your declarations for sensors are using braces, as well as make sure to not misplace the locations of curved brackets.
@[TVA]Connor is correct about the brackets and the while (or similar) loop. Presumably this is one of several commands within a greater while(true) or similar loop for user input. If it isn’t, do that right away. Also, your else if part should be > or >= 2000 and the last else removed, or else you stop when you get to 500. But you’re going to run into problems. Presumably