The honest answer is simple: practice.
The Impossible Quiz lives up to its name, and the only real way through it is to keep at it, learn from each attempt, and gradually memorize the tricks it throws at you.