Tom,
You could either do a modified if statement or a case and switch statement. I think since two of your if statements should result in the same action, you would be best with a modified if statement like this:
if (($x%2=0 AND $y%2=0) OR ($x%2!=0 AND $y%2!=0)) {
DO NOTHING
} elseif (($x%2=0 AND $y%2!=0) OR ($x%2!=0 AND $y%2=0)) {
GO CRAZY
}