You could look at boolean operations.
if (backState == LOW)
backState = HIGH;
else
backState = LOW;
is the same as:
backState = !backState;
except that the latter is many fewer lines of code.
You could (and really should) learn to post code properly. There is an icon above the little gray box where you type and paste that has a # on it. Use that icon before pasting code.
You could (and really, really should) investigate the Tools + Auto Format option. It will do worlds of good for your code. Put each { on a separate line, too.
Finally, you should upload the code to the Arduino and see for yourself what it does. You will learn far more than you would if we told you what the code does.
Looking at the reference page would help, too. There are only a few function calls that you make (millis(), pinMode(), and digitalWrite()). You could go review what those do. The millis() function, for instance, returns the number of milliseconds that the Arduino has been running. Now, if you are not aware that there are 1000 milliseconds in a second, google is your friend.
If you are, then you could look at that code, and see where numeric values that are multiples of 1000 occur (the value assigned to interval). It is not that difficult to follow the logic of the program, and see where that value (internal) is used. It is pretty easy to change the value and observe the results. See what it does at the current value. Change the value to a different multiple of 1000, like 15000 for instance, and see what happens.
Then, you can, relatively easily, figure out what the value needs to be to get a 4 second interval.
When you have the interval correct for two motors, look at the structure of the code. There is a block of code that gets executed IF the time is right. Look at what that block of code does. Currently, it toggles the state of two different pins.
Now, how hard do you suppose it will be to change what will be 4 lines of code to toggle two pins to n lines of code to toggle three pins? Pretty easy, once you figure out what n needs to be, and what (here's a hint) two lines of code need to be copied and pasted (and then changed) to deal with three pins, instead.