what kind of script have you created?
Device? Time? Security? All?... is that enabled also?
blocky in that way is not functional because you will have no option to turn the lamp off (well you can turn it off, but when the script is called, it will be back on)
so a good solution is the one proposed by theolsen...
change the time condition to:
(time <= sunset) and (time >= dusk)
but to have the script executed ONLY when needed and don't have it spam your email.... I would add one more condition:
((time <= sunset) and (time >= dusk)) and (Luz_Rampa = 'On')
so it will switch on and send an email ONLY if it's off
have the script running as TIME (so it will run once a minute)
ciao
M