My shoots are a bit dark but the hightlights are bright,
I would like to increase the dark intensities but keep the brights lower.
How can I do (what settings?) that using LUA script?
If your shadows are too dark and highlights too bright, you've run out of dynamic range. There's not much you can do to fix this with a single exposure. If you aren't already, shooting raw / DNG would give you more flexibility to push the shadows and slightly more dynamic range.
For jpeg, some cameras have a feature called "iContrast" in the Canon firmware, which is supposed to give better results in contrasty scenes.
If the scene you are shooting is suitable for multiple exposures, you could use HDR, either by bracketing with CHDK and processing yourself, or in-camera HDR if your cameras supports it.
Note that CHDK raw / DNG are not compatible with in-camera HDR.