The problem is identifying a change of the button state and time it. There is a nice example named Debounce under "File - Sketchbook - Examples - Digital" in the Arduino IDE.
Another tip, you should test for the limits of x right after changing it, not at the end of the loop. This is to not waste a loop with a value of x that will never be used. Also, more importantly, it might cause strange bugs in other programs (if you use the same method), depending on what you do with the variable.
Note that if it is in mode 2 (flashing red and blue), it may not register a buttonpress if you press it quickly (<600 ms before the red LED turns off again). An improvent would be to use another timer variable like with the button.
I modified this somewhat according to the Debounce example, also I got some other pin nr's than you but that's just because I got other things on my arduino at the moment. You may change those back of course.
Also note that if you leave this running for >50 days or how long it takes the millis() function to wrap to zero, you will probably have trouble pressing the buttons again. 
Yet another tip would be to place a little capacitor across (in parallell with) the pullup or pulldown resistor. It would be a small resistance to the high-frequency bounce, effectively shorting it. In theory
This should still be used in conjunction with some method of timing the button press. Out of the blue (that is, my guesstimate) I would recommend choosing an RC-value of roughly equal to an acceptable/realistic debounce time. In one application (Ok, my only one so far, second with this one) I used 20k pulldown and 100nF, a bit on the short side for debounce time ( R * C = 2 milliseconds) but that's just because I had several of those caps. Also I'm not sure if a pullup/down should be much more than 20k.. (also the Arduino's built-in pullup is 20k). It worked pretty well even without timing the debounce (used another way of checking when the button was released again).
Oh, and 200 ms for debounce time is a bit excessive I think. But I let it be as is here for now. I would think 20 is enough (especially with caps. Works for me at least.).
If anyone have comments/improvements please let me know! In particular, how high can the pullup and/or pulldown resistor be?
Code based somewhat on the Debounce example:
// 3-mode blue and red
const int ledRed = 3; // assign red LED to pin 2
const int ledBlue = 2; // assign blue LED to pin 3
const int buttonPin = 7; // assign tactile switch to pin 7
int button = 0; // current state of button
int previousButton = 0; // previous debounced state of button
unsigned long deBounceTimer = 0;
const unsigned long deBounceDelay = 200; // increase if you get multiple presses in one buttonpress.
int x = 0; // a number that tells us where we are in the cycle
void setup() // setting things up
{
pinMode(ledBlue, OUTPUT); // set blue LED pin to output
pinMode(ledRed, OUTPUT); // set red LED pin to output
pinMode(buttonPin,INPUT); // set button pin as input
}
void loop() // starting loop
{
button = digitalRead(buttonPin); // read current state of the button
// If button changed state to pressed and stayed there for > deBounceDelay milliseconds:
if (button && !previousButton && (millis()-deBounceTimer) > deBounceDelay)
{
x++;
if (x>2)x=0; // variable x is reset to 0 and the cycle begins again
previousButton = button; // set previous state to current state which is debounced and assumed sure.
deBounceTimer = millis(); // reset debouncetimer
}
// If button changed state to not pressed and stayed there for > deBounceDelay milliseconds:
if (!button && previousButton && (millis()-deBounceTimer) > deBounceDelay)
{
previousButton = button; // set previous state to current state which is debounced and assumed sure.
deBounceTimer = millis(); // reset debouncetimer
}
if(x==0) { // first mode
digitalWrite(ledRed, LOW); // makes sure red is turned off
digitalWrite(ledBlue, HIGH); // turns on blue
}
if(x==1) { // second mode
digitalWrite(ledBlue, LOW); // turns off blue
digitalWrite(ledRed, HIGH);
} // turns on red
if(x==2) { // third mode, flashing
digitalWrite(ledRed, LOW); // turns off red
digitalWrite(ledBlue, HIGH); // turns on blue
delay(300); // waits 300 milliseconds
digitalWrite(ledBlue, LOW); // turns off blue
digitalWrite(ledRed, HIGH); // turns on red
delay(300); // waits 300 milliseconds
}
}