Will this if-statement do what I want it to do?
if(pieceIsTaken == true && ( z!= 0 && z != 7 && z != 31 && z != 24)){
For the if statement to be true:
- pieceIsTaken must always be true
- and z must not be equal to 0, 7, 31, or 24
I suppose you could do it without brackets, but I want to know if it works in principle. Like in Maths where (5+1)(4+2)=66=36, so that the stuff within brackets is solved first.
Thanks 
In the time it took you to post the question, you could have tested it....
Edit... seems to work as you expect with this code:
// set the following variables for all your test cases and re-upload
bool pieceIsTaken= true;
byte z= 31;
void setup()
{
 Serial.begin(9600);
 if(pieceIsTaken == true && ( z!= 0 && z != 7 && z != 31 && z != 24))
 {
  Serial.print("good");
 }
 else
 {
  Serial.print("NOT good");
 }
}
void loop(){
}
Not only is it legitimate, it is preferable. Using brackets means that you do not have to remember the order of preference of operators (BODMAS) beyond the fact that expressions in Brackets are evaluated first.
I learnt it as BOMDAS. Same effect though. Things have not changed much in 55 years!
Brackets also make it easier for readers to work out what you are doing.
Weedpharma