Section 7J. In any federally aided program, the department of highways, in this section referred to as the department, is hereby authorized and directed to do all things necessary to comply with the provisions of the Uniform Relocation Assistance and Real Property Acquisition Policies Act of 1970 (Public Law 91–646), as amended and supplemented, or with any other federal act relating to relocation assistance or acquisition, insofar as the federal government requires compliance with said Public Law 91–646 or said other federal acts in order to receive said federal aid. Under a federally aided program, in relation to any person whose real property is acquired, in whole or in part, by the department for a highway purpose, or any person lawfully occupying real property acquired by the department for highway purposes, or any person who vacated real property at the written request of the department because of a proposed acquisition for highway purposes, the department is hereby authorized and directed to make such payments, provide such assistance and do such other things as are necessary for the department to comply with the Federal Uniform Relocation Assistance and Real Property Acquisition Policies Act of 1970. If a highway project is not federally aided, then in relation to any person whose real property is acquired, in whole or in part, by the department for highway purposes, or any person lawfully occupying real property acquired by the department for highway purposes, or any person who vacates real property at the written request of the department because of a proposed acquisition for highway purposes, the department shall make the same payments, provide the same assistance and do the same things as the department would be required to pay to, provide or do for such persons under a federally aided program. This section shall not affect the obligations of the department under chapter seventy-nine A.