Problems tracking pin state with Switch statement

I guess I should simply work around it then? Since the 'easiest' direct solution I can think of is multithreading.