Hi Guys,
although this seems to be answered a idea for a nonscripting way:
1. Create a paragraph style with autonumbering in a separate textframe with Autosize > width only.
2. Insert your textframe with the numbers
3. Write your text, add or delete some numbers, half way done
4. You will maybe discover a problem, that is shown in my screenshot. Sometimes the textframes and the followed character are overlapping. I think this is a bug.
5. Solution: Create a shortcut for "Recompose all stories immediately". After refreshing the document everything is fine, so no script needed
–Kai