Hi there, I think that if your Sim has become a child, then you can't befriend the Imaginary Friend.
While your Sim is a toddler, he/she will play with the IF doll and get two messages. The first message will say that your toddler likes the IF. The second message is: "Imaginary Friend has become a very special toy for Sim!Toddler. Who knows what will happen if s/he keeps playing with it? Maybe they'll stay as good friends when s/he grows up!"
If you don't get this message, the IF will stay a doll for ever...
...unless you cheat, like I did ;)
http://forums.thesims.com/en_US/discussion/912542/imaginary-friend-wont-come-to-life-solved
This link is useful too:
https://www.carls-sims-3-guide.com/generations/imaginaryfriend.php