Do you know what is wrong?
Typically you would tell us what’s wrong when you post to a “How do I…?” forum.
Do you even have an animation or action that plays for the enemy when you press a key? If you wanna move it, try with an angular force or something like that.
Simulating pressing Right or Left us only going to work if the Enemy is a platformer character…which I assume it’s not. So, @Sweet is correct. You’ll want to change “simulate pressing right/left” to adding a force (of your choosing, depending on how fast you want the Enemy to move) at an angle if either 0 or 180.