In this protip I just put this function inside Modernizer library near all other tests and used class that Modernizer generate for all test on html tag. And in case of addValue test you need to add implementation after Modernizer object exist and call it with Modernizr.addValueTest('transform-style','preserve-3d');
Also if you want to see live example go to this link http://mag.walla.co.il/ open in sources commmon.js and look for preserve3d also you will see same class name on html tag.
Thanks, I updated post with your fix.
Also I find out that may be its not good idea to implement window.getComputedStyle because some libraries (like jquery.animate-enhanced) rely on that IE7 ,IE8 doesnt have it. So in my project I changed it to local function.