Use use a library for that. It does all the work for you so you don’t have to reinvent the wheel (Dutch saying). I use the Bounce library.
Also, as a rule of thumb. If you are writing code (like variables) and you think, mm, this looks like a lot of repetition/work there is probably a better/easier way to do it. Like using array’s 
You just end up with something like
/* This code is to control a simple LED strip with 2 yellow LEDs on the sides, 6 red and blue LEDs inbetween those, and 5 clear LEDs inbetween those.
-Made by Mike P. (Mike44449) */
#include <toneAC.h>
#include <Bounce2.h>
//The following variables are for the mode selection
const byte ModeButtonsMap[] = {51, 49, 47, 45};
Bounce modeButtons[sizeof(ModeButtonsMap)];
/* Don't need this
const int modeButton1 = 51;
const int modeButton2 = 49;
const int modeButton3 = 47;
const int modeButton4 = 45; */
//The following variables are for the debug keyboard
const byte KeyboardMap[] = {A7, A6, A5, A4, A3, A2, A1, A0};
Bounce keyboard[sizeof(KeyboardMap)];
#define LYB 0
#define RYB 1
#define YB 2
#define RB 3
#define WB 4
#define BB 5
#define ACB 6
#define IMB 7
//made the following list a lot smaller ;)
//The following is the ON indicator light
const byte powerOnLED = 53;
//The following is for the LED strip
//Yellow
const byte ly[] = {22, 23, 14, 42};
//Red
const byte red[] = {24, 25, 26, 27, 28, 29};
//Clear/White
const byte clear[] = {30, 31, 32, 33, 35};
//Blue
const byte blue[] = {35, 36, 37, 38, 49, 40};
//ButtonState Components
/* Are now gone :p
*/
void setup() {
// put your setup code here, to run once:
//Turn on the green power LED
pinMode(powerOnLED,OUTPUT);
digitalWrite(powerOnLED,HIGH);
//Label all inputs/outputs as so:
//Mode buttons
for(byte i = 0; i < sizeof(ModeButtonsMap); i++){
pinMode(ModeButtonsMap[i], INPUT_PULLUP);
modeButtons[i].attach(ModeButtonsMap[i]);
}
//Debug Keyboard
for(byte i = 0; i < sizeof(KeyboardMap); i++){
pinMode(KeyboardMap, INPUT_PULLUP);
keyboard[i].attach(KeyboardMap[i]);
}
//LEDs:
//Yellow
for(byte i = 0; i < sizeof(ly); i++){
pinMode(ly[i]. OUTPUT);
}
//Red
for(byte i = 0; i < sizeof(red); i++){
pinMode(red[i]. OUTPUT);
}
//Clear
for(byte i = 0; i < sizeof(clear); i++){
pinMode(clear[i]. OUTPUT);
}
//Blue
for(byte i = 0; i < sizeof(blue); i++){
pinMode(blue[i]. OUTPUT);
}
}
void loop() {
//Update (check/read) all the mode buttons, incl debounce
for(byte i = 0; i < sizeof(ModeButtonsMap); i++){
modeButtons[i].update();
}
//Update (check/read) whole keyboard, incl debounce
for(byte i = 0; i < sizeof(KeyboardMap); i++){
keyboard[i].update();
}
// put your main code here, to run repeatedly:
}
Now you can just use the library functions like:
modeButtons[0].read(); //return state of first button
modeButtons[1].changed(); //returns if the second button changed since last update/loop
modeButtons[2].fell(); //returns if the third buttons became pressed since the last loop (because of pullups the buttons are active low)
//same for keyboard
keyboard[RB].rose(); //returns if the red buttons was released since the last update/loop
//etc