(a) On motion by a person who has been the subject of a complaint filed under this chapter or on the court's own motion, the court may vacate its order and findings and order the sealing of the legal and social records of the court, Youth Services Administration, and of any other agency in the case if it finds that:
(1) two years have elapsed since the final discharge of the person from legal custody or supervision, or the entry of any other court order not involving custody or supervision; and
(2) he has not been convicted of a felony or misdemeanor, and no proceeding is pending seeking a conviction or adjudication. The motion and the order may include the files and records specified in sections 2527, 2528 and 2529 of this title.
(b) Reasonable notice of the motion shall be given to:
(1) the Attorney General; and
(2) the Youth Services Administration; and
(3) the law enforcement officers and department having custody of the files and records, if the files and records specified in section 2527 are included in the motion.
(c) Upon entry of the order, the proceedings in the case shall be treated as if they never occurred, and all index references shall be deleted and the court and law enforcement and departments shall reply and the person may reply to any inquiry that no record exists with respect to such a person. Copies of the order shall be sent to each agency or official named therein. However, the court shall maintain a special index reference to sealed records under the direct control of the Clerk of Court or his designee. No person shall have access to this special index without order of the court. Inspection of the files and records included in the order may thereafter be permitted by the court to those persons or departments named in the motion in defense of an action filed by the child against the person or departments named. Provided, however, the court in its discretion may by special order in an individual case permit inspection by or release information in the records to any clinic, hospital or agency which has the person under care or treatment. Also in the situation where individuals or agencies are engaged in fact finding or research the court may allow nonidentifiable information to be given.
(d) Any adjudication of delinquency or person in need of supervision or conviction of a crime subsequent to sealing and prior to the child becoming an adult shall have the effect of nullifying the sealing order.
(e) On motion on the part of a person who has been the subject of a complaint filed under this subchapter or on the court's own motion, the court may order the expunging of all legal and social records of the court, Youth Services Administration, and of any other agency pertaining to a case, if the child is found to be not delinquent.