http://www.d20srd.org/srd/spells/wallOfForce.htm
he was within 25ft+5ft per 2 levels (way closer really)
he had line of sight (the dragon was talking and you could look in it's mouth...)
The wall is anchored on all sides (the sides of the throat)
I'm not sure you can argue if it works RAW or not... but I could have had ways around it... I could have done a lot different. However when the whole table cheered and my jaw dropped, I was pretty inclined to give it to him.
According to the SRD it needs to be vertical, so it can't fit into a creature's throat. It must be unbroken, so it can't cross the skin of the dragon. It says it is in square ft. I'd definitely rule that the shape always has to be square. I'm sure other people wouldn't, but my reading is that you get to choose the amount of square feet and get a vertical square or rectangular wall.
You could look in it's mouth, that's for sure, but I'd surely say you couldn't see into its throat unless a dragon's neck is just one big hollow tube.
At best, I'd allow you to put it inside its mouth as sort of a lozenge. It would take split timing to estimate the exact right size of the wall to not cross or touch any part of the dragon. Which would be even harder if the dragon was talking and therefore moving its mouth open and closed.
Also, a wall of force doesn't have to be anchored. Rather it's the exact opposite, it doesn't say anything about anchoring it, it can't move and it stays wherever you put it. Assuming the dragon could open its mouth slightly wider than it was when the spell was cast, all it would have to do is open it wider and move its mouth away from where it was located when the wall was created.
Plus, purely in a "Rules as Intended" way of thinking about it....the spell wasn't designed to kill anyone, that much is fairly apparent. It's a level 5 spell, but using it in the way described makes it much more powerful than some 9th level spells. Plus, it's way more versatile since it can now be used as a guaranteed no dice rolled kill on almost anything you can see in addition to being a wall spell. That means it fails my standard "Are you attempting to cheat the game?" test.
The general test I use to determine whether to allow something weird is a standard "Balance Insanity Test". Basically, I compare the action you are attempting to the standard options available. If your suggestion seems to be much more powerful than other options at its level and it is repeatable then I deny it outright if only for purely balance reasons. I don't want to run a game where all battles are decided by the same spell over and over again. It's boring and removes all the suspense from the game. After all, from that point onward EVERY spell of 5th level or higher would be prepared as Wall of Force.
Unfortunately, players LOVE situations where they win in one hit. After all, its their job to find new, awesome ways to win with no effort. That's the reason for my Balance Insanity Test...and the reason they'd all prepare Wall of Forces as all their spells for the rest of their lives. But what players THINK they want and what actually makes the game fun for people are two different things. Will they cheer that they just found an way to beat an impossibly powerful monster? Sure, after all, the point was that it was impossible and they just managed to do the impossible. Will the game be fun for them 10 sessions later when they've defeated every encounter since then with it? Unlikely. They'll complain about being bored with combat and how easy it is to win, so why bother having them?
Sometimes you need to say no in order to keep a handle on things and prevent them from going completely crazy. Otherwise, you'll end up like a Rifts campaign I ran once where the group literally had 500 long ranged fusion missiles mounted on a building that could all be fired at once or at 500 separate targets. The campaign got to the point where they refused to leave their building because it was the safest place in the world. If I sent enemies against them, they'd hit "THE BUTTON" and destroy them utterly. They had infinite money because I let them use their telemechanics power actually add money to their credit cards. The game ended because it was boring for me to run and there was nothing left on the planet that could defeat them.