Don't think of NAO as a little child that get scared of the dark. In this program, NAO shows that he is not a stupid robot, and that he is not afraid of the dark, even if it is sudden!
Very simple! Run the downloaded .crg file from Choregraphe, or embed it in your behavior.
Use this Choregraphe code on your NAO as it is, or embed it in your behaviors. Either turn off the light in the room (make it completely dark) or cover NAO's cameras with something black or dark that is blocking the light. (Watch the video for an example). The robot has to be in a sitting postion in order to play this behavior! The animation doesnt take into account another poistion.