Defeating the Bookcase
Flippendo him in the front repeatedly until you see him fall. You will then be able to pull the box to the end. Then, jump from pillar to pillar and you find the spell book. It will allow you to destroy Green Goop-A-Goop.
To avoid being hit by the Bookcase, after you Flippendo it, it will start to shake. Run behind another bookshelf and wait until you see two groups of books go by, or listen for two swishes. Then, run back and repeat the process.