He wrote Emma’s name down because he needed to remember it. Her name was the trigger that would make him regain his memories back. Remember, he begged Snow and Charming for Emma’s name in the pilot episode because he needed to hear it so that he would have a way to regain his memories when he arrived in Storybrooke.
I think this makes the most sense. I would also like to mention that Rumple can glimpse the future, so maybe he didn’t know who would come from the portal, but he could tell that Emma would be trapped in there at some point.
Also, I have to point out what Gold said at the beginning of the episode. With David still asleep, they don’t even know if Snow received their message. So, even though he knows that Emma and Snow would defeat Cora if they had the ink, he has absolutely no idea of knowing whether or not they even know about it.