How do I make my gameobject stop at a certain point?

I’m having problems getting my gameobject to stop at its original position which has been determined as a vector. The script works fine when the player passes a trigger the gameobject does move forward and once the player encounters the second trigger the gameobject moves back as well. But, at that point the gameobjects continues to move back and I want it to stop at its original starting point. Any tips on how I can make this possible?

Here is my code:

using UnityEngine;
using System.Collections;

public class MovingSpikes : MonoBehaviour {
	
	public Vector3 SpikePos;
	public float SpikeMove = 1f;
	float SpikeSpeed = 1f;
	public float minimum = 10.0f;
    public float maximum = 20.0f;
	public float speed = 5f;
	private GameObject Spikes;
	public bool isHitTrigger = false;
	public bool hasHitTrigger = false;
	
	public Vector3 spikeStartPosition;
	void Start () 
	{
		Spikes = GameObject.FindGameObjectWithTag("SpikeLever");
		spikeStartPosition = Spikes.transform.localPosition;
	}
	
		void OnTriggerEnter (Collider playerCollision)
	{
		
	if (playerCollision.CompareTag("Player"))
    {
			
			 isHitTrigger = true;
			 hasHitTrigger = true;
			Debug.Log("Collision with Player detected");
    }
	}
	
	void Update () 
	{
		if(hasHitTrigger)
		{
			if(isHitTrigger)
			{
				Spikes.transform.position = new Vector3(Spikes.transform.localPosition.x + .4f, Spikes.transform.localPosition.y, Spikes.transform.localPosition.z);
			}
			else
			{
				if(isHitTrigger == false)
				{
				Spikes.transform.position = new Vector3(Spikes.transform.localPosition.x - .8f, Spikes.transform.localPosition.y, Spikes.transform.localPosition.z);
				}
				if(Spikes.transform.localPosition == spikeStartPosition)
				{
					Spikes.transform.localPosition = spikeStartPosition;
					
				}
			}
			}
	}
}
,I have a script that triggers a gameObject to move forward when a player hits a collider. And the gameObject does move in the desired direction. But, the problem comes from when the player hits a second trigger to make the gameObject move in the opposite direction. The gameObject does  go back in the opposite direction but I want it to stop when the gameObjects reaches its starting point. How can I make the gameObject stop when it reaches it's starting point?

Here is my Code:

using UnityEngine;
using System.Collections;

public class MovingSpikes : MonoBehaviour {
	
	public Vector3 SpikePos;
	public float SpikeMove = 1f;
	float SpikeSpeed = 1f;
	public float minimum = 10.0f;
    public float maximum = 20.0f;
	public float speed = 5f;
	private GameObject Spikes;
	public bool isHitTrigger = false;
	public bool hasHitTrigger = false;
	
	public Vector3 spikeStartPosition;
	void Start () 
	{
		Spikes = GameObject.FindGameObjectWithTag("SpikeLever");
		spikeStartPosition = Spikes.transform.localPosition;
	}
	
		void OnTriggerEnter (Collider playerCollision)
	{
		
	if (playerCollision.CompareTag("Player"))
    {
			
			 isHitTrigger = true;
			 hasHitTrigger = true;
			Debug.Log("Collision with Player detected");
    }
	}
	
	void Update () 
	{
		if(hasHitTrigger)
		{
			if(isHitTrigger)
			{
				Spikes.transform.position = new Vector3(Spikes.transform.localPosition.x + .4f, Spikes.transform.localPosition.y, Spikes.transform.localPosition.z);
			}
			else
			{
				if(isHitTrigger == false)
				{
				Spikes.transform.position = new Vector3(Spikes.transform.localPosition.x - .8f, Spikes.transform.localPosition.y, Spikes.transform.localPosition.z);
					Spikes.transform.localPosition = spikeStartPosition;
				}
				if(Spikes.transform.localPosition == spikeStartPosition)
				{
					Spikes.transform.localPosition = spikeStartPosition;
					
				}
			}
			}
	}
}

Hi,Post only one script
What your are trying to achieve is very simple
okay lets say i the object has hit the second trigger
(i didnt notice you making it go in reverse when it hits a collider and you havent set the isHitTrigger to false )
and by second trigger did you mean entering another trigger area if so follow the script
Anyways here is an example to make the object to go back to its initial pos

using UnityEngine;
    using System.Collections;
     
    public class Test: MonoBehaviour {
    public float MoveForwardBy;
    public float MoveSpeed;
    public GameObject Spike;
    Vector3 InitialPos;
Vector3 FinalPos;
    bool hasEntered;

    void Start{
    InitialPos = Spike.transform.localPosition;
    FinalPos = Vector3(Spike.transform.localPosition.x + MoveForwardBy,Spike.transform.localPosition.y,Spike.transform.localPosition.z);
    }
    void OnTriggerEnter(Collider Col){
    if(col.tag == "Player"){
    hasEntered = true;
    }
    }
    void OnTriggerExit(Collider Col){
if(Col.tag == "Player"){
hasEntered = false;
}
   }
void Update(){
if(hasEntered){
Spike.transform.localPosition = Vector3.Lerp(Spike.transform.localPosition, FinalPos,Time.deltaTime * MoveSpeed);//Use Vector3.Lerp for smoother and realistic movement

}else{
Spike.transform.localPosition = Vector3.Lerp(Spike.transform.localPosition,InitialPos,Time.deltaTime * MoveSpeed);//Move Back to start pos
}
}
    }

Get rid of localPosition. Just use spikes.transform.position. Local space as opposed to world space