If she ran away from the foster home while she was also taking drug and alcohol classes, it doesn't look good. Drugs and alcohol are a major concern. I doubt a judge would give the baby back. There are many factors to consider that cannot be answered on this post. Consider retaining a lawyer to help in these difficult times.
You should ensure that the social worker is aware that you are open to adopting this child. In certain circumstances, the social worker may want to remove the child to avoid the issue of bonding between child and foster parent.
Consult an attorney as you may want to ensure that that all relevant information of the situation is considered, and if retained, this attorney would already have the information and would only be a telephone call away to ensuring that you are afforded a hearing before the child is placed elsewhere.