if you wanted a script to do it then I would give a sine a go, that way you can use the output of the sine function (as it will be between 0 and 1) to drive the light intensity.