Check if the enemy.x is within range (say 50 pixels, or width of player, etc.) of player.x, and do another random respawn if it is
e.g. if abs( player.x - enemy.x) < 50 -> try another spawn
Or just check if the sprites are overlapping, and do another random respawn if they are (keep the enemy invisible until then).
There are other ways too, like not spawning on the player's location in the first place..