Modify the scale depending on the order of the keyframe values
To shorten what you've already written you could pack all the open mouth values into an array and then find if the x value is in it:

var scaleYVals = [1 , 3, 7, 10, 11];
(scaleYVals.indexOf(x) &gt; -1)? [148,199] : [148, 189];


The second line uses the ternary form of if (foo){bar} else {baz}, which can be written as (foo)? bar : baz. IndexOf returns the index of an element of an array, so if the value of x (bad name for a variable except if you're referring to an x coordinate, BTW) is 7 then indexOf will return 2. If the value is not in the array it returns -1

The problem with looking at the previous mouth shape is that you could still end up with no movement: say there was a sequence: open, open, closed. If you disable the stretching on the second open mouth you'll have the sequence stetched, unstretched, unstretched. It also greatly complicates the expression.

How about you make it so that the stretch happens at the beginning of the open mouth and then goes back briefly before the next phoneme?