My frog went through the phase of opening his mouth randomly. It stopped after a week or so and he's been fine since. I read somewhere on the forum that tree frogs shed - still don't know if this is true, but it was described that when they shed they often don't eat and act strangely like this.

Either way, I don't think it's a big problem, unless he starts to lose a lot of weight and keeps refusing to eat.