I gave a child up for adoption at birth, so I know the feeling of not wanting to get close to another child. It was a struggle for me for a very long time. She is 17 now and I am finally pregnant with my second child.
What I had to do was let go, really let go. I grieved for seven years, cried all the time, and it wasn't until someone I loved gave me an ultimatum similar to what your boyfriend gave you that I had something that was more important to me than my grief and I let it go.
When I read the title of your post I thought... "failed adoption".. why did it take her 2 years to get over it? But reading your post I see that you've actually spent alot of time with this child, it wasn't just a birth mother changing her mind at the last minute. This must be a child that is in your family and you've bonded with her.
My advice, count your blessings, you get to be a part of her life, even if it is not as her mother. You are still young and can have the family you want so badly. My adoption was an open adoption and I've been allowed to spend time every year with my daughter. As much as it still hurts, I feel so blessed that I get the chance to know her and she gets to also know that she is loved all the way around.
One last thing, sorry this is long. If you are unsure of your boyfriend and the future of your relationship, I would keep a guard up where his dauther is concerned, to protect your heart should the relationship not work out. It is very hard to lose a man and a child at the same time.