I'd probably use
range_lerp to map the
green components of the progress bar's color value to the appropriate ranges based on its current value.
So, something like this:
$ProgressBar.value = 10
var r = range_lerp($ProgressBar.value, 10, 100, 1, 0)
var g = range_lerp($ProgressBar.value, 10, 100, 0, 1)
var styleBox = $ProgressBar.get("custom_styles/fg")
styleBox.bg_color = Color(r, g, 0)
That should smoothly map between red and green as the progress bar's value increases. However, mixing roughly equal parts of red and green in the middle of your range may not give you the color(s) you expect.