Coroutine animator with root motion

I have this 3D game where you’ll be moving your character via buttons, you’ll stack your commands and will hit a certain button to execute it.

So for example, i’ll hit ‘forward-forward-jump’ it will send 112 on my script and separate them
since my first two commands are 1, i need my character to play “run” animation twice and then jump.

But the problem is when it plays run animation it runs forever…
and when it plays jump it just freezes and doesnt run the next command.

Here’s my code.

    private Animator anim;
    private bool runToIdle = false;
    private bool jumpToIdle = false;
    private string moveCount = "";

    void Start () {
        anim = gameObject.GetComponentInChildren<Animator> ();
    }
    public void executeAction(){
        string[] arr = moveCount.Split ('>');
        int[] iarr = new int[arr.Length-1];
        for (int i=0; i<arr.Length-1; i++) {
            int.TryParse(arr[i],out iarr[i]);
        }
        StartCoroutine(Move (iarr));
    }
    public void setAction(int moveKey){
        if (moveKey==5) {
            executeAction();
        } else {
            moveCount = string.Concat (moveCount, moveKey.ToString () + ">");
        }
    }
    IEnumerator MoveImplementation(int command){
        float t;
        if(command==1){
            t = 0.5f;
            runToIdle = true;
            jumpToIdle = false;
        } else {
            t = 0.9f;
            runToIdle = false;
            jumpToIdle = true;
        }
        anim.SetInteger ("IntParameter", command);
        yield return new WaitForSeconds (t);
    }
    IEnumerator Move(int[] iarr){
        for (int i=0; i<iarr.Length; i++) {
            Debug.Log (iarr[i]);
            StartCoroutine(MoveImplementation(iarr[i]));
            yield return new WaitForSeconds (0.5f);
        }
        if(runToIdle){
            anim.SetInteger("IntParameter",0);
        }
        else if(jumpToIdle){
            anim.SetInteger("IntParameter",3);
        }
    }

Not to discourage the way you are working - but maybe you’d like to check out the mecanim tutorials which have some very helpful and simple steps to solve your problems.
I know your using code for your animations - but why? The problems you are running into (I read your other post also) are easily solvable by checking/unchecking options on the animation files.
My guess - without having Unity open at the moment is you need to uncheck loop on your run cycle and check has exit time on your jump.
What you are attempting to do via code is a couple check marks in the Unity inspector.

Hope this helps or at least directs to the correct solution.