Hello
I need a package or anything that can make this for marked lines

There is nothing people can do to modify line numbers iirc. There is just no API.
The S840D language support package provides a function called “Update Block numbers”, which updates the Nxxx of the whole file.
Do you need this feature to add/update block numbers for selected lines only?
Is it for G-Code block numbers only or a general feature request.
May star block and step size keep fixed or do you need any input / setting.
I could query for start block and step size by two input controls.
I also think about step size as a setting maybe project setting.
Just pushed CNC S840D language support v1.3.3 with ability to renumber selected blocks as you requested.
The S840D: Add/Update block numbers command now asks for the “First Block Number”.
You can use it or leave empty.
If empty, it looks for "s840d_gcode_block_start": ... in one of ST’s settings files (syntax/user/project) or uses the default value 0. You can set "s840d_gcode_block_increment": ... to the step width for block number incrementing.