How can I interface with these 24 V signals?
Wealthy man, he? :-)

Seriously, you can do this with far less components. Simply use a resistive voltage divider. 

  

For 24 V to 5 V you could use R1 = 39 k\$\Omega\$ and R2 = 10 k\$\Omega\$. If your 24 V signal can supply the current you can decrease the resistor values. Lower resistance means less sensitivity to noise. You could place a 100 nF cap parallel to R2 to filter the signal.

I would do the debouncing in software. I usually sample at a 32 ms timer, and filter out isolated 0 or 1 levels. So 000100111 becomes 000000111.