You're basically right, Akis, yes. As per the little table in the data sheet, if you see "A" go low, and then before anything else changes "B" also goes low, you know the shaft has been turned clockwise. But if "B" goes low and before anything else changes "A" goes low, then the shaft has been rotated counterclockwise.
Ideally, you might do this with interupts (or "interupt on change" if your processor has it). This way, you can also time the gap between successive rotations, and set your software to do speed-dependant changes - i.e., the faster you spin the knob, the much faster you increment or decrement the value.
You could do it by polling every few ms if you don't want to use interupts, but you risk missing the occasional pusle, which will make the "action" of the knob feel a bit hit-and-miss.
I scan both bits frequently, and compare to the previous scan. Both bits can only ever be 00, 01, 10 or 11. Compare with previous value and determine directions. Use 4K7 pull-up resistors and 0.1 uf glitch-catching caps to ground, to kill switch bounce. Job done!