Huh, didn't know abbrev had that limitation (wonder why?). Gave it a go in espanso (https://espanso.org/), and it does work there.
Edit: it would need context awareness too, which somewhat rules out espanso, otherwise space indentation will be difficult. abbrevs at least can be defined per mode, but ideally it would be based off the face (so it could work in comments or strings).
Edit: it would need context awareness too, which somewhat rules out espanso, otherwise space indentation will be difficult. abbrevs at least can be defined per mode, but ideally it would be based off the face (so it could work in comments or strings).