setup_timer_2
First, i find the circuit a little bit strange. Output 1 if input 1, output 2 if input1 and input 2 and so on. Anyway, for any output to go high, pin 1 must be high. But that means only the first part of the code is executed and the program skips down to the end of the if, else if, and else clauses. So the logic is faulty. Test each case sequentially with if statements, no else if stuff.
Also if all inputs are low then all of the clauses are true and will be executed. All conditons should be unique for each clause. Like if pin 1 do A, else if pin 2 do B and so on. In this case the pin 1 clause would have the highest priority. You could check to make sure that one and only one pin was set and so on before you perform any action but that is up to you.
Also, are the dip switches debounced? run the inputs through a CMOS buffer chip (the input gates must be CMOS) and use the appropriate values for the resistor and capacitor (it's just a filter). I can't remember the values, just google switch debouncing, something should come up. Or just use the delay_ms() statement to double-check that the pin is still low.
Also just use if(input(PIN_E0), forget the ==0 stuff, it's not necessayr since the input function returns a 1 or a 0 (it's boolean) already.
Hope that helps.