This Shadow&Highlight script does a decent job of lightening shadows and/or darken highlights in photographs. The UI gives you five control sliders. Two for control of the Shadow and Highlight amount (opacity), two for the tonal width of each contrast mask layer (using gamma), and one for the blur radius of the masks. Plus the option to flatten visible layers when done.
A note on the tonal width sliders, the Shadow Tonal width works as expected giving a wider/heavier tonal range using higher value. But the Highlight Tonal width behaves opposite, affecting a smaller tonal range using higher values.