I haven't messed with this stuff in a while, but one thing you might want to try is have a page you go to when you eat, and then put in the item the script to increase your energy variable.
The "item effect" thing is to take you to a page, and when it does that, it will run the item script. Unless I'm misremembering how this all works, of course.