In the event that a developer submits an application for development proposing a development that is barred or prevented, directly or indirectly by a legal action instituted by any State agency, political subdivision or other party to protect the public health and welfare or by a directive or order issued by any State agency, political subdivision or court of competent jurisdiction to protect the public health and welfare, the municipal agency shall process such application for development in accordance with this chapter, and, if such application for development complies with this chapter, the municipal agency shall approve such application conditioned on removal of such legal barrier to development.