Concatenating Integer variables

Arduino gives you bit commands

From the Arduino Reference Page. These are links to pages on each function.
Bits and Bytes

bit()
bitClear()
bitRead()
bitSet()
bitWrite()
highByte()
lowByte()

My problem with what you are doing is that I don't like to see people torture themselves so badly to learn so little, to miss so much.

Those 4 encoder bits, you can read them all on a single port in one cycle, mask them in the next and put that through a switch-case statement to do the appropriate thing fast enough to not miss a click -- when you're ready.