I would recommend learning how to create a "state-machine" (I believe that is what they are called).
So you would have an instance variable called "state" and depending on what that is corresponds with what he does. Timer behavior would be needed to go along with this.
Example:
If state = "right" then simulate right
If state = "left" then simulate left
If state = "idle" then idle animation
On Timer
-state = "left" or "right" then state = "idle"
-state = "idle"
--Choose(0, 1) > 0 then state = "left"
--Else state = "right"
Restart Timer
This is the basics, if you want more states then just map out the order that they should move through states. For example one I've done for shooting zombies is idle -> aim -> fire -> recoil -> recover(just a pause) -> idle ... but from idle a different chain can occur such as move, reload, etc.
Jumping at random intervals can be done as a state or separately with a timer. When setting state to left or right start the state timer and also a jump timer (can set to random time). On timer simulate jump.
Edit: definitely add the "Else" where applicable in above commands