If I didn't miss anything you read the encoders exactly once per command received from the serial interface. These polls have to be done continuously, at least while the motors are turning.
In encoderinit() you have to blocks of code. What's the reason for that? The compiler doesn't need it.