Have you copied the global variables too and added the WebGL effect to the layer?
It also gets a little more complicated than that as the event code in the example works by manipulating the "luminance" depending on how much in-game time has passed since the start of the game.
As in, the effect begins the moment you start the game and ends in about 2 seconds.
So if you want it to work as an effect you can trigger on a certain condition, you will need to make some changes.
I think the example given is actually quite flexible and doesn't require much editing to turn it into a triggered effect, you just need to get an idea of the in-game time and how it works and know what you're doing, and adapt it to your needs and events.
Just need to practice and toy around with it.