This is such a simple implementation, I don't think you need anything other than a handful of (set:) macros, really:
Stress: {
(set: $meter to '_________')
(unless: $stress < 1 or $stress > 9)[
(set: $meter's ($stress) to (text: $stress))
]
(if: $stress < 5)[
(set: $stressColor to (colour: 'red'))
]
(else:)[
(set: $stressColor to (colour: 'green'))
]
$stressColor[|$meter|]}
If you only want to change the color of the number and not the whole bar, you can do that, too. It's a bit more annoying, and a bit hack-y, but it's probably how I'd do it:
Stress: {(set: $stress to 4)
(set: $meter to (a: '_', '_', '_', '_', '_', '_', '_', '_', '_'))
(if: $stress < 5)[
(set: $stressColor to (colour: 'red'))
]
(else:)[
(set: $stressColor to (colour: 'green'))
]
(unless: $stress < 1 or $stress > 9)[
(set: $meter's ($stress) to '$stressColor[' + (text: $stress) + ']')
]
|(print: $meter.join(''))|}
You can add your delta code the same way, with (set: $meter's ($Stress - $StressC) ...). I forgot about it and didn't test it out, though.