For starters, utilize return; rather than nesting a ton of if/else statements within each other. Try running trace to get a better idea what's going on with the packages. Also, you have several echos in there, so what's coming up in the console in each scenario?
Well, I figured it out. I changed serverCmdLight(%pl.client); inside the flEnergyDrain() function to schedule(1,0,serverCmdLight,%pl.client); and it works. I have no idea why it works though.