Light effects via scripts?

Since the light effects under each bulb is something natively supported by the bulb it self, i was wondering if i could make a bulb “flicker” in the sense that it looks like a candle where it dims/brightens slightly all the time via a script? And the same goes for a “good morning” script that would slowly increase the brightness of a light over a custom set time.

Can someone assist on how to create a script that does this if its possible?