You could try, and this is just an example, it might not work at all but it may help you find the answer.
int timer = 0; //global var
if(ButtonUp == HIGH) {
timer = millis();// get the current time in milliseconds, and store it.
if((millis() - timer ) / 1000 == 3) { //Look at the new time and subtract it from the old time,
//then if the difference of the two times are divisible by 1000
//and equals 3 (seconds) do your function.
//change mode, maybe use case statement
//timer = 0; //reset timer
}
}
if(ButtonDn == HIGH) {
.
.
.
}