Here's a response from to someone else who had the same problem...
Sometimes cichlids damage their mouths by extending it out too much or hitting the bottom or side of the tank getting food. There is a little bone that runs down the center of the forehead. When the mouth is extended too far this bone sticks and the bone can not be retracted. Sometimes the bone slips back in place and the mouth heals over time. Other times it stays stuck and there is not too much that can be done. Some aquarists have tried to manipulate this forehead bone with limited success. If it looks like it is not getting back to normal in a weak I would think about trying to work it back in before it calcifies in place. Good Luck.
"If it has been lip locking it is possible that it has a dislocated jaw. This has also been known to happen to Oscars that aggressively attack the glass, to the point that they dislocate the jaw. It is important to try to pop the jaw back into place as soon as you notice it. The longer it stays that way, the less likely you will be able to do it. I have never had this problem myself, but recently talked to some other experienced fish keepers about it. The way I heard it done was the fish was submerged in a net as the jaw was carefully massaged and eased back and forth, ultimately into its natural position. It took some time, and patience, but well worth it.
I hope this helps, give it a try. sometimes the fish can naturally put it back into place itself, usually when yawning, but if yours has been like this for a while, it probably can't and you need to do it yourself. In the wild if this happens from lip locking, the fish with the dislocated jaw will end up dieing from starvation. If you cannot fix the problem, try talking to a experienced fish store and see if they have any experience with this, if so see if they would be willing to try fixing your fish for you. Other than that you would have to euthanize the fish to save it from a slow death."
To me it looks as if the lower jaw might be dislocated, necessitating massaging the lower sides of the jaw where it connects with the upper. I think the gill flaring is simply a side effect of the extended jaw/mouth position and the consequent intake of water.
At first I thought perhaps there might be some sort of disease that could cause lock-jaw of a sort in Oscars, but I found nothing to that effect. I thought it might be a good idea to research that possibility first before subjecting yourself and your oscar to the quite stressful procedure of trying to 'massage his jaw back into place.' Anyways, I would do it at this point...sometimes I've heard they work themselves back into place, but if it's been a while already I would go ahead and try it as opposed to having him not be able to eat sufficiently or euthanizing him.