If you've already found an example of some code which creates more or less the desired lighting pattern, and your problem is only to terminate it after 30 minutes, then post the code here and you'll get some suggestions.
Maybe also include a sketch of your circuit - even a picture of a hand drawn diagram is OK.