Changing object location every 3 second

I am working on very simple slender man game.
The problem is my location change code works really weird.

Here is the code:

#pragma strict
var Spawn1 : Transform;
var Spawn2 : Transform;
var Spawn3 : Transform;
var Spawn4 : Transform;

function Update () 
{
spawn();
}

	function spawn ()
	{
	yield WaitForSeconds (3);
	this.transform.position = Spawn1.position;
	yield WaitForSeconds (3);
	this.transform.position = Spawn2.position;
	}

Try this(it was not tested), assign the Transforms in the inspector.

import System.Collections.Generic; // To use list

#pragma strict
var spawnPositions : List.<Transform> = new List.<Transform>(); // Add as many as you want in the inspector
var spawnIndex : int = 0;

function Update () 
{
  // If not invoking, invoke the spawn method.
	if (!IsInvoking("spawn"))
		Invoke("spawn", 3); // Invoke every 3 seconds if not invoking already
}
 
function spawn ()
{
	this.transform.position = spawnPositions[spawnIndex].position; // Set this gameobjects transform to the spawnIndex of spawnPositions
	
	spawnIndex++; // Increment the currentIndex
	
	// The index is 0 based when accessing items in the list, we need to compare the count minus 1 to see if we need to reset the spawnIndex.
	if (spawnIndex > spawnPositions.Count - 1)
		spawnIndex = 0;
}

var t : float;
var threshold : float = 3.0f;
var newPos : Vector3;

function Update() {

     t += Timer.deltaTime;
     if(t >= threshold) {
          t = 0.0f;
          transform.position = newPos;
     }


}

How you determing the next position is up to you; you could use

newPos = new Vector3(Random.Range(0,100), 0, Random.Range(0,100));

so it randomly pikcs a ground position between 0 and 100 and the x and z axis.