Coroutine and transform.position

Lets say I have a plane and cube positioned at 0,0,0.

IEnumerator Destroy()
            {
             yield return new WaitForSeconds(1.5f);
             this.gameObject.transform.position = new Vector3(this.gameObject.transform.position.x, Random.Range(-100, 100));
             }

and a coroutine in my update() method:

    StartCoroutine(Destroy());

what I want to accomplish is that the cube will rise from under the plane wait for 1.5 seconds and then go back down. Now the only issue is that the waiting time i.e. 1.5 seconds only occur at the start then it no longer waits i.e. it continues going up and down?

The problem is, that you are starting multiple Coroutines in the update loop. So you are mixing two different ways of working.

Version 1 is using a coroutine:

void Start()
{
  //start Coroutine one 1 time
  StartCoroutine(BounceCube());
}

IEnumerator BounceCube()
{
  while(true)
  {
    yield return new WaitForSeconds(1.5f);
    transform.position = new Vector3(transform.position.x, Random.Range(-100, 100), transform.position.z);
  }
}

Version 2 is using the update loop:

float time = 0;
void Update()
{
  if(time <= 0)
  {
    time = 1.5f
    transform.position = new Vector3(transform.position.x, Random.Range(-100, 100), transform.position.z);
  }
  time -= Time.deltatime;
}

Both versions of course will not have smooth transitions, but I wasn't sure what you are looking for.

Does that code work? I see two values in your new vector. Don't you need three? Anyway if you are calling the coroutine every update then you essentially keep launching coroutines every frame. It sounds like what you want to do is use Mathf.PingPong and either launch it from Start or in update conditionally say something like (Edit on 10/12 with tested code):

using System;

using UnityEngine;

public class CubeExample : MonoBehaviour

{
    GameObject cube;
    Light light;

    public void Start ()

    {

        cube = GameObject.CreatePrimitive (PrimitiveType.Cube);
        cube.transform.position = Vector3.zero;

        GameObject lightObject = new GameObject("MyLight");
        light = lightObject.AddComponent<Light>();
        light.type = LightType.Point;
        light.transform.position = new Vector3 (0, 3, -3);

        Camera.main.transform.position = new Vector3 (0, 0, -3);
        Camera.main.transform.LookAt (Vector3.zero);

    }

    public void Update ()

    {
        cube.transform.position = new Vector3 (cube.transform.position.x, -1 + Mathf.PingPong (Time.time, 2), cube.transform.position.z);
    }
}