Spawn only a certain number of enemies over a certain time

OK I cobled together a simple "Alien Zombie" spawner using an empty game object and attaching a spawn script. I have about 3 of them strategically placed on my game terrain and they spawn every 200 seconds which after a lot of test playing I think is a fairly safe number to allow my players to explore the terrain and figure out where they need to go and what they need to do.

But just in case I'm wondering if there is a way to make this spawn ONLY a certain number of Alien Zombies over a certain time period.

Say something like after a maximum of 200 Zombie Aliens (Number to be tweaked based on ammo caches available on my terrain) STOP spawning them so that if my player runs out of ammo or takes longer to figure out where and what to do that they won't get OVERRUN with Alien Zombies.

I hope this makes sense, if not, let me know and I'll try explaining it in another way ;)

var alienZombiePrefab : GameObject;

InvokeRepeating("SpawnZombie" , 200, 200);

function SpawnZombie () {

        Instantiate(alienZombiePrefab, transform.position, transform.rotation);

}

EDIT

Almo this is what's in my Awake function in my AlienZombieAI script from what you have done bellow:

function Awake (){

    var tempobj : GameObject = GameObject.FindWithTag("ZombieCounter");
    var countScript : ZombieCountScript countScript = tempobj.GetComponent(ZombieCountScript);
    countScript.m_numZombies++;

    var tempobj : GameObject = GameObject.FindWithTag("ZombieCounter");
    var countScript : ZombieCountScript = tempobj.GetComponent(ZombieCountScript);
    countScript.m_numZombies--; 

}

I get an error for line 17: Assets/WeaponScripts/ZombieAlienAI.js(17,44): UCE0001: ';' expected. Insert a semicolon at the end.

Which is this line:

var countScript : ZombieCountScript countScript = tempobj.GetComponent(ZombieCountScript);

EDIT: *Almo*:

I changed my code to this in my AI script:

function Awake (){

    var tempobj : GameObject = GameObject.FindWithTag("ZombieCounter");
    var countScript : ZombieCountScript = tempobj.GetComponent(ZombieCountScript);
    countScript.m_numZombies++;
}

Now I get the following errors: Error 1: Assets/Misc Scripts/ZombieCountScript.js(6,24): BCE0019: 'm_numZombies' is not a member of 'ZombieCountScript'.

Error 2 Assets/Misc Scripts/ZombieCountScript.js(8,29): BCE0005: Unknown identifier: 'alienZombiePrefab'.

Error 3 Assets/WeaponScripts/ZombieAlienAI.js(18,21): BCE0019: 'm_numZombies' is not a member of 'ZombieCountScript'.

????

My Zombie Counter Script:

function SpawnZombie () {

    var tempobj : GameObject = GameObject.FindWithTag("ZombieCounter");
    var countScript : ZombieCountScript = tempobj.GetComponent(ZombieCountScript);

    if(countScript.m_numZombies < 200)
    {
        Instantiate(alienZombiePrefab, transform.position, transform.rotation);
    }
}

Still call InvokeRepeating on SpawnZombie, but add the stuff below to cap the total number.

Create a script called ZombieCountScript with an integer member m_numZombies and attach it to an object tagged "ZombieCounter".

function SpawnZombie () {

    var tempobj : GameObject = GameObject.FindWithTag("ZombieCounter");
    var countScript : ZombieCountScript = tempobj.GetComponent(ZombieCountScript);

    if(countScript.m_numZombies < 200)
    {
        Instantiate(alienZombiePrefab, transform.position, transform.rotation);
    }
}

And in your Zombie Script's Awake() function

var tempobj : GameObject = GameObject.FindWithTag("ZombieCounter");
var countScript : ZombieCountScript countScript = tempobj.GetComponent(ZombieCountScript);
countScript.m_numZombies++;

And wherever a Zombie is killed

var tempobj : GameObject = GameObject.FindWithTag("ZombieCounter");
var countScript : ZombieCountScript = tempobj.GetComponent(ZombieCountScript);
countScript.m_numZombies--;

I got another way of doing it:

        var alienZombiePrefab : GameObject;
var zombieNumber : int = 0;
    if (zombieNumber < 201){
InvokeRepeating("SpawnZombie" , 200, 200);
}
    function SpawnZombie () {
            Instantiate(alienZombiePrefab, transform.position, transform.rotation);
zombieNumber++;
    }

I haven't checked it or anything, but I'd do something along those lines.