I haven't looked at the cap, but I've got a few tips...
If you want enemies to fire only when on-screen, just add a condition "Is On Screen", I believe sprites have that.
Then add another event that checks when the sprite is out of visible area (Negated On Screen), trigger once, set the 'ammo' to 2. So, whenever it flies onto screen, it would fire two bullets, then as soon as it flies out, it would refresh ammunition.
For random firing, try for every 1000+random(2000) ms. That will randomize it a bit between one and three seconds. Fire a bullet, substract by one, stop firing when it hits 0 ammo.
When you say add condition "is on screen" do you mean to the enemy or the bullet?
And when you say Negated on screen, is that in system or on the enemy sprite?
Also I cant get your random formula to work. Do I put it in as written?