Hello;
You didn't mention what Software language is being used to program the board, but, the best way to go about that is to mask the port, so you can have 4 bits working as input or output.
If you mask the port, you can still use your code as the port was a 4 bit port.
Hope this helps.
Filipe