Help! Need to complete code

Hi, I'm trying to complete a code using a couple of leds, one servo, two buttons (one to start, other to interrupt the process), a buzzer and a tilt sensor.

When the start button is pushed, ledPin1 must turn on, ledPin2 off, servo start and delay for a minute (can't make sweep slower either). After completed, ledPin1 must turn off, ledPin2 on and the buzzer on for an alarm that stops when the tilt sensor is activated.

I have the main codes but can't connect them to make them work in such sequence. Please help!

//constants won't change. Used to set pin numbers:
const int buttonPin1 = 2;   // Start/stop button
const int buttonPin2 = 4;   // Pause/play button

const int ledPin1 = 13;     // Red led: timer starts
const int ledPin2 = 5;      // Green led: timer stops, break time

const int buzzer = 8;       // buzzer alert

const int switchTilt = 7;   // tilt sensor

const int servoPin = 9;     // servo


//variables will change:
int buttonState = 0;        // Variable for reading the start button status

int val = 0;                // value tilt sensor

#include <Servo.h>
Servo servo_9;
int angle = 0;              // servo position in degrees



//-------------

void setup() {
// put your setup code here, to run once:
Serial.begin(9600);
pinMode(13, OUTPUT);          // ledPin1: red led
pinMode(5, OUTPUT);           // ledPin2: green led
pinMode(2, INPUT_PULLUP);     // buttonPin1: start stop button
pinMode(4, INPUT_PULLUP);     // buttonPin2: pause play button
pinMode(7, INPUT);            // switchTilt 
pinMode(8, OUTPUT);           // buzzer

servo_9.write(angle); //sets initial position
servo_9.attach(9);            // servo

}

void loop() {
// put your main code here, to run repeatedly:
digitalRead(3);
digitalRead(5);
digitalRead(7);
digitalRead(8);
digitalRead(9);
digitalRead(13);

/*if buttonPin1 pushed, ledPin1 on, ledPin2 off, timer and servo on.
when finished or servo in 0 position, ledPin1 off, ledPin2 on, buzzer on.
buzzer off and ledPin2 off when tilt sensor moved.
*/

buttonState = digitalRead(2);    // read the state of pushbutton start

if (buttonState == HIGH) {      // if button start pushed
  digitalWrite(13, HIGH);      // red led on
  digitalWrite(5, LOW);        // green led off

for(angle = 0; angle < 180; angle+=1)    // sweep from 0 to 180 degrees (figure out timer)
  servo_9.write(180);
delay (2000);
} 

else {
  digitalWrite(13, LOW);       // red led off
  digitalWrite(5, HIGH);       // green led on
  
  tone(8, 1000);          // 1khz sound signal for 1 sec, then stop for 1 sec
  delay (1000);
  noTone(8);
  delay (2000);
  
for(angle = 180; angle > 0; angle-=1)   // sweep from 180 to 0 degrees
  servo_9.write(0);
  delay (1000);
}
  
val = digitalRead(7);    // switchTilt
if (val == HIGH){
  digitalWrite(5, LOW);  //green led off
  noTone(8);             // buzzer off
}

buttonState = digitalRead(4);

if (buttonState == HIGH){
  digitalWrite(13, LOW);
  digitalWrite(5, HIGH);
  delay (1000);
}


delay(10); // Delay a little bit to improve simulation performance
}

You define your pin numbers as constants at the beginning of the program (good) and then you use the actual pin numbers throughout your program (bad).

I would suggest you look of this thread to see how to do multiple things at the same time.

You could also do this by using a state machine (look up finite state machine) but that might be more advanced than you want/need.