Update...
If you're really just after some code - perhaps these specific face fitting/tracking libraries might be more what you are after (although I know they are more tending towards Active Appearance Models...)
I'm afraid that I don't have code for exactly what you're trying (it's been 7 years since I did any of this stuff I things have moved on somewhat. Good luck!)
...
Model issues aside - it sounds to me that you know what you are doing, and just need to express it in a form that you can use with any number of optimisation libraries out there...
Iām sure you probably know all this - but for this particular problem, short of asking the authors themselves for the code, or implementing it yourself, you are left with existing libraries. The issue then is often tailoring your model to work with them (hence my earlier questions).
e.g.
http://www.gnu.org/software/gsl/manual/html_node/Multimin-Algorithms.html
https://software.sandia.gov/opt++/
In turn used by many higher-level libraries, such as...
http://docs.scipy.org/doc/scipy/reference/optimize.html
http://stat.ethz.ch/R-manual/R-devel/library/stats/html/optim.html
http://weka.sourceforge.net/doc.dev/weka/core/Optimization.html
etc.
I think I can anticipate your core problem, which is that many of these ``off-the-shelf'' methods will not deliver the best fitting - since the number of parameters is pretty big and (as you hint at) are hard to factor.
As is so often the case with any form of model-fitting in Computer Vision, key advances are linked to fundamentally better optimisation (algorithm) and representation (data-structure/model).
So you could look at more experimental libraries, as opposed to the established ones above:
http://deeplearning.net/software/pylearn2/
http://ab-initio.mit.edu/wiki/index.php/NLopt