I think you need to keep track of the previous state of the buttons, and do things only if the current state is not the same as the previous state. As that code is now, the switch may appear pressed for many iterations of loop.
Why are you hung up on using a pin for both input and output? Is it that you don't have enough pins? How many inputs and how many outputs do you need?