(a) The court at any stage of a proceeding pursuant to this code may appoint a special advocate for the child who shall serve until discharged by the court and whose primary duties shall be to advocate the best interests of the child and assist the child in obtaining a permanent, safe and homelike placement. The court-appointed special advocate shall have such qualifications and perform such specific duties and responsibilities as prescribed by rule of the supreme court.

(b) Any person participating in a judicial proceeding as a court-appointed special advocate shall be presumed prima facie to be acting in good faith and in so doing shall be immune from any civil liability that otherwise might be incurred or imposed.