The only font metrics exposed to scripting are ascent and descent. Please submit a feature request and join me in nagging Adobe to expose cap height and x-height too. And sidebearings.
You can calculate cap and x-height as you suggest, by outlining a character, do some measurement, and undoing the outlining, but in my experience there's a quicker way (though equally naff): add a text frame, set its first baseline offset to cap height, duplicate a character into the frame, add an 'X', and get the character's baseline. Remove the frame.
For now, I found a quick solution by manually computing static ratios (upper and lower cases ratios) that I call depending on the contents. This client uses only a bunch of fonts and the front office also needs to use those ratios. So I guess that will be our way of doing things.
However, I could have needed those cap height, x height values on some other projects and outlining for that purpose seems totally cumbersome to me. So I will make a feature request as suggested
And that's done !