Unfortunately you cannot. The parser that processes the yaml is only a limited expression parser, not a full JavaScript implementation. So, you cannot do full declarations or control loops, etc.
For your use case the lengthy nested if-then is the best option.
One other suggestion is to use Scale - Transformation Services | openHAB, either with a state description “pattern” or a profile.
So you would need to write a file like:
[..0.05[=green
[0.05..0.1[=yellow
...
Then you will have to duplicate your KNX_KIND1_HEIZUNG_STATUS_STELLWERT item, linking it to the same channel, and naming it KNX_KIND1_HEIZUNG_STATUS_STELLWERT_color for example, and either:
set its state description to `SCALE(yourfile.scale):%s (in this case your item remains of the Number type)
configure the link with the “SCALE” profile, configuring it appropriately with the .scale file name (in this case your item should be of the String type)
In the former case you should then get the appropriate color string (“green”, “yellow” etc.) with items.KNX_KIND1_HEIZUNG_STATUS_STELLWERT_color.displayState, in the latter case though, your item’s actual state will be the result of the transformation so you should use items.KNX_KIND1_HEIZUNG_STATUS_STELLWERT_color.state