Section 18. The office of the attorney general shall appear for the department, its divisions, departments, agencies and officers, but not including the Massachusetts Bay Transportation Authority, the regional transit authorities and the Massachusetts Port Authority and their officers, in all suits and other civil proceedings in which the department is a party or interested, or in which the official acts and doings of said divisions, departments, agencies and officers are called into question, to the same extent and in the same manner as provided to the commonwealth and state departments, officers and commissions under section 3 of chapter 12. The department and its divisions, departments and agencies, but not including the Massachusetts Bay Transportation Authority, the regional transit authorities and the Massachusetts Port Authority, shall be generally considered to be an agency of the commonwealth for purposes of: (i) said chapter 12; (ii) any general or special law pertaining to judicial remedies or procedures; and (iii) court rules and standing orders; and shall not be considered to be encompassed by the words ''person'' or ''whoever'' in any general or special law unless a contrary intention clearly appears.