I need to stop lights turning on while baby is sleeping

That sounds like a good approach. A hello home action can change the mode, so if you’re triggering a hello home action, you should be able to have that hello home action put it into the mode “baby sleeping”. You shouldn’t need to write your own smart app to do that, although you can, of course.

The following might also be relevant: