Can I set an Arduino pin as input and output?
No there is no function that lets you set all the pins to either input or output at the same time, but it wouldn't take much to write one.

No, you can't set an Arduino's pin as bidirectional.  If you are running out of pins look at IO expanders or multiple Arduinos.

Hope that helps, if not please feel free to clarify what it is you would like to know and we'll try and help.