In the full code you've posted, presumably modified via your friend?, the QEI interrupts are disabled - your original code enabled them.
I'll give you a simple 'example'
Your mother has three friends - Mr. Uart, Mrs Timer and Miss QEI.
She tells you to go to Mr. Uart's house, and do what he tells you - he gives you a cake, and tells you to take it back to your mother.
Next, she tells you to go to Mrs. Timer's house, and do what she tells you - she gives you a loaf of bread, and tells you to take it back to your mother.
Finally, she tells you to go to Miss QEI's house, and do what she tells you - you get there, and no one is in - so you spend the rest of your live standing outside waiting for instructions from her.
That's a VERY crude and simple example of what you were doing.