I can see a couple of problems, but the reason the loop never gets repeated after the LEDs are turned off by the tilt sensor, is the value of i is now equal to num_pins or 4. When you repress the push button, it tries to turn on pins[4] then pin[5], etc.. The variable i needs to get reset. Also, the initialization of the pins to LOW, should go in setup since it only needs to happen once. Here's some code that should work. Be aware I haven't actually tried it yet, so I could have easily made a mistake.
void setup()
{
// add this to the setup
for(int i = 0; i < num_pins; i++)
digitalWrite(pins[i], LOW); // initialises state of the led at the i array position.
}
void loop()
{
val = digitalRead(inPin); // read input value of push button
val2 = digitalRead(inPin2); // read input value of tilt switch
int i;
if(val == LOW) // following code is executed if button is pressed
{
for(i = 0; i < num_pins; i++) // turn on LEDs one by one
{
digitalWrite(pins[i], HIGH);
delay(200); // wait
}
}
if(val2 == 1) // following code is executed if tilt switch is moved
{
for(int i = 0; i< num_pins; i++)
digitalWrite(pins[i], LOW); // turns LED off
}
}