I'll be damned. It was in the script.
http://www.geocities.com/uss_patriot_4/Star_Trek_II.htm
Scene 18 is when Chekov sees the child looking at him through the porthole. And indeed, in Scene 213A, the child wanders into the transporter room and gets next to the Genesis device during the countdown.