You need a "return;" statement after the activated section, otherwise the cog will process the deactivated statements immediately after the activated ones. The deactivated message is triggered when you finish activating (you release the space bar) so you need a different section in the activated message part instead. Remove the "local" after the light things otherwise you can't enter the thing numbers in JED.
If there's a chance that the player can "activate" the light things by touching them besides just the switch then you'll need to check for the linkid of the switch.
I modified Scott's code and also added the function of changing the switch cell mat on and off, and added sounds. I haven't tested this. I'm assuming that the SetThingLight function is what you want. Otherwise you might want to find out how to use those tricky dynamic lights (which I haven't learned yet). If there's a problem you can e-mail me.
------------------
Sylvicolus JK homepage
If I have ever made any valuable discoveries, it has been owing more to
patient observation than to any other reason. -Isaac Newton
Sylvicolus JK homepage
If I have ever made any valuable discoveries, it has been owing more to
patient observation than to any other reason. -Isaac Newton