The test for val == HIGH and old_val == LOW suggests that you are using external pulldown resistors, yet no mention is made of how the switches are wired.
I'd suggest that you ditch the external pulldown resistors, if you indeed used any, and use the internal pullup resistors. Connect one side of the switch to the digital pin, and connect the other side to ground.
The switch will then read HIGH when not pressed and LOW when pressed.
Put each { on a new line. Use Tools + Auto Format to properly indent the code. Use some white space to separate logical blocks of code.
You have some code that deals with state == 0, but nothing that deals with state == 1. I'd suggest that compound if statements are not the way to go. Nested if statements are.
if(state == 1)
{
if(millis() - startTime >= 10000)
{
}
else
{
}
}
else
{
// Similar test for time
}
The else blocks can be empty. Their presence, with or without code, at least indicates that you considered the need for them, and decided that there was nothing to do in that block.