Spawning trouble

Hello, I'm having trouble with a script for Mass Spawning to create a swarm of enemies in a side scrolling shooter game. It respawns but makes more than the intended number. Also they are too closely summoned, so I wanted to add a Wait function before continuing the loop but the code didn't seem to work. Does anyone have suggestions?

//What enemy are we spawning?
var Enemy: GameObject;
//Add regular timer here and rest timer
function Update () {
//Is the enemy already Out?
//Change to timer in future?
if (GameObject.FindWithTag("Enemy") == false){
Wait 0 seconds before triggering the Mass Spawn function
Invoke("MassSpawn", 0);
}
else
{
CancelInvoke();
}
}

function MassSpawn(){
//Set up a loop to add until i =5, loop 5 times, make 5 respawns
for(var i: int = 0; i < 5; i++ ){
//WaitForSeconds(1);
Instantiate(Enemy, transform.position, Quaternion.identity);

    }
}

You want to call the function normally instead of using Invoke if you want to use it as a coroutine, and then use yield before WaitForSeconds. You also need some sort of check to make sure you're not running the coroutine multiple times. e.g.:

//What enemy are we spawning?
var Enemy: GameObject;
var spawning = false;

//Add regular timer here and rest timer
function Update () {
    //Is the enemy already Out?
    //Change to timer in future?
    if (!spawning && GameObject.FindWithTag("Enemy") == null){
        MassSpawn();
    }
}

function MassSpawn() {
    if (spawning) yield break;
    spawning = true;
    //Set up a loop to add until i =5, loop 5 times, make 5 respawns
    for(var i: int = 0; i < 5; i++ ){
        yield WaitForSeconds(1); //this should work now
        Instantiate(Enemy, transform.position, Quaternion.identity);
    }
    spawning = false;
}