there' nothing wrong in flipping between Input and Output on a pin mid-program... just keep track of what you're doing and ensure nothing clashes. I often have LED's and Buttons on the same pin for example.