Enemy AI ~ help!

I’m having a problem here … making a shooting game.
It’s about the enemy AI … I can’t seem to make it appear and dissappear the way I want it to be …

Like appears from behind a table, holds for a frames and goes back down hiding behind the table …
I want it to appear randomly throughout the screen…