Why do the people with dementia do what they do?
suss out the answer to that and you will be so rich you will be able employ a butler to supervise him!
My theory on the lights would be action/consequence.
if you think about flicking a light switch it is miraculous really, click and you get light, click and you get darkness.
If you are a person that feels that they are controlling nothing that might be an activity that makes you feel good?
i would try putting a standard or table lamp inside the room.
I would explain we had a power surge in the night and all the bulbs in the main light fitting had blown , I have removed them and I need to replace them when shopping next week .
Then see if he continues with the activity.
Remember if an older person doesn’t have enough light it could make a fall more likely.
i would go to the GP and discuss if Melatonin would help him. It isnt a drug that keeps you asleep but one that helps to drop off in the first place.
As always a small milky drink immediately before bed can be good.
If all else failed and the behaviour was stressing me out then I would call in an electrician and get him to spur off the light switch and put a new one above the door frame in the hall, so when the behaviour was driving me mad I would skip along the hall and click the master switch. The person in the bedroom could then flick the switch until the cows came home and it will do them no good!
The last cure is quite expensive. But if my mum needs care it will be £1200 a week, if spending money means they can stay in their home, then the cost of a few adaptations is small fry.
Warning, when one behaviour stops, another one often starts !