How to make work for example “sub one zero by ten”, if ten is an individual design.
Put that code into a feature in Font Info > Features?
Yes, a stylistic set.
That should work according to the OpenType spec, but some applications might not want to apply a ligature substitution for a stylistic set. There is little you can do in that case.
True. I thought of making a range of figures from 0 to 20 which each number as an own glyph design. But for numbers like 2025, I want to switch automatically back to 2+0+2+5 (and not 20+2+5). What would be a clever way of coding this?
Depends on the design. For a capsule shape, you can start with something like this: