Right, it doesn't block anything. I thought you got this from existing working code. I don't even know if this method of hooking that command works. Once you get it to compile you will be able to test it (or I'm sure it's posted somewhere on this forum on how to do it).
My advice is to start very simple and test it (just print a message). Then, you can make it more complex by adding things and testing afterwards.