I don't think Kayaba worked on SAO alone. This is never explicitly stated. It's likely he had a large part in it, and created most of the core, and designed most of the elements of the game, but I can't see one guy creating everything alone.
Yui was possibly created by someone else who worked on the game (Or possibly even Cardinal). SAO was the first real VR Game, so the effects of being inside a VR world for long periods of time weren't really known. The Cardinal System was created with the intention of being self-managing, so that humans were never needed, to manage to game, or even to update/patch the game. A program to take care of a player's mental health (to possibly avoid law-suits?) was probably part of the plan for that.
Here's a link to a translation of a sort of "Q&A" that the author had with fans, and characters of the story, back in 2005 (when SAO was still a web-novel.)
Q. Did you know about Yui’s existence?
A. I didn’t spare it any attention at all, a great opportunity gone by.
From that, you can infer that Kayaba himself didn't create Yui.