As usual, there are many ways to do this.
I think one of the easiest ways is to put a Platform behavior on your enemy, but turn the default controls off. Then when an event occurs you can simulate jump, left and right controls. If the player gets within a certain distance of the slime, simulate right if player.x is greater than slime.x and left control if player.x < slime.x. Here is an example (created with release 93):
If you haven't checked out JohnnySix's patrolling example in the arcade, you should. Very cool example, and you can download the capx to see how he did it.