Condensing Code

Your examples of go forward and left turn are good ones. Write the code that makes the hexapod go forward and put that code in a function with a meaningful name. Then, when you want to go forward call the function by using its name. You could perhaps make the function move the bot forward at different speeds and tell it what speed to use when calling the function.

Have you used any of the Arduino functions such as digitalWrite() ? The code for the function is built into the system but you could just as well write your own. So you could then make the bot go forwards like this

goForward(1);  //go forward at speed 1
goForward(2);  //go forward at speed 2

The function could also be written to move a given number of distance units

goForward(10);  //go forward 10 units
goForward(20);  //go forward 20 units

Whatever you want do do you have to write and test the code first. Have you written any code for your project ?