Enemy in 3d C# Wont Follow my Player, and now it says parsing error.

using UnityEngine;
using System.Collections;

namespace CompleteProject
{
public class EnemyMovement : MonoBehaviour
{
Transform player; // Reference to the player’s position.
PlayerHealth playerHealth; // Reference to the player’s health.
EnemyHealth enemyHealth; // Reference to this enemy’s health.
NavMeshAgent nav; // Reference to the nav mesh agent.

	private Transform myTransform;
	
	void Awake() {
		myTransform = transform;
	}
	
	// Use this for initialization
	void Start () {
		GameObject go = GameObject.FindGameObjectWithTag("Player");
		
		target = go.transform;
		
		maxDistance = 1;    
	}
	
	// Update is called once per frame
	void Update () {
		Debug.DrawLine(target.position, myTransform.position, Color.yellow);
		
		//Look at target
		myTransform.rotation = Quaternion.Slerp(myTransform.rotation, Quaternion.LookRotation(target.position - myTransform.position), rotationSpeed * Time.deltaTime);
		
		if(Vector3.Distance(target.position, myTransform.position) > maxDistance) {
			//Move towards target
			myTransform.position += myTransform.forward * moveSpeed * Time.deltaTime;

    {
        // Set up the references.
        player = GameObject.FindGameObjectWithTag ("Player").transform;
        playerHealth = player.GetComponent <PlayerHealth> ();
        enemyHealth = GetComponent <EnemyHealth> ();
        nav = GetComponent <NavMeshAgent> ();
    }

 
    {
        // If the enemy and the player have health left...
        if(enemyHealth.currentHealth > 0 && playerHealth.currentHealth > 0)
        {
            // ... set the destination of the nav mesh agent to the player.
            nav.SetDestination (player.position);
        }
        // Otherwise...
        else
        {
            // ... disable the nav mesh agent.
            nav.enabled = false;
        }
			}

This part:

if(Vector3.Distance(target.position, myTransform.position) > maxDistance) {
             //Move towards target
             myTransform.position += myTransform.forward * moveSpeed * Time.deltaTime;

Is where it begins to be wrong. Following it are a bunch of {}s that make no sense; Some just surround a code block without any if statement or similar.

I have corrected the whole Update function to show you:

void Update () {
         Debug.DrawLine(target.position, myTransform.position, Color.yellow);
         
         //Look at target
         myTransform.rotation = Quaternion.Slerp(myTransform.rotation, Quaternion.LookRotation(target.position - myTransform.position), rotationSpeed * Time.deltaTime);
         
         if(Vector3.Distance(target.position, myTransform.position) > maxDistance) {
             //Move towards target
             myTransform.position += myTransform.forward * moveSpeed * Time.deltaTime;
         }//missing, added by me
 
 
     //{//wrong!
         // Set up the references.
         player = GameObject.FindGameObjectWithTag ("Player").transform;
         playerHealth = player.GetComponent <PlayerHealth> ();
         enemyHealth = GetComponent <EnemyHealth> ();
         nav = GetComponent <NavMeshAgent> ();
     //}//wrong!
 
 
  
     //{//wrong!
         // If the enemy and the player have health left...
         if(enemyHealth.currentHealth > 0 && playerHealth.currentHealth > 0)
         {
             // ... set the destination of the nav mesh agent to the player.
             nav.SetDestination (player.position);
         }
         // Otherwise...
         else
         {
             // ... disable the nav mesh agent.
             nav.enabled = false;
         }
             }//right (closes the Updte function)