In a proceeding for a grant of custodial responsibility pursuant to sections 518E.301 to 518E.311, the following rules apply:

Terms Used In Minnesota Statutes 518E.305

(1) a prior judicial order designating custodial responsibility in the event of deployment is binding on the court unless the circumstances meet the requirements of law of this state other than this chapter for modifying a judicial order regarding custodial responsibility; and

(2) the court shall enforce a prior written agreement between the parents for designating custodial responsibility in the event of deployment, including an agreement executed under sections 518E.201 to 518E.205, unless the court finds that the agreement is contrary to the best interest of the child.