Thank you very much for the reply.
I willl try with the scripts you kindly mention right away, but before starting I will try to explain my situation better.
The file has no styles at all, only normal+ for characters and paragraps. So I have normal+ that should actually be called “title” paragraph style, another normal+ that should be “subchapter title” paragraph style and so on.
Many times I have also superscript fonts, again normal+, used for the numbers of the notes that appear in the main text, that perhaps should be “maintext superscript endnote number” character style (I am not actually sure what the best practice would be so suggestions are welcome).
Given that I need to export to EPUB I need as much consistency as possible, plus, and here is another big part of my question although originally I put it as a secondary question, I would like to make notes that refer back and forward (that is number in main text to endnote text and endnote text to number in main text) through crossreferences/hyperlinks/anchors, so that, when I export to epub, I have a file with notes that can be viewed in a click and with another click the person reading can go back to the main text.
Here again, I am not sure what the best practice is among InDesign pros, but I feel overwhelmed by the thought of actually having to manually select each of the superscript numbers in the main text, make it an anchor, then go to the relative endnote, make it an anchor as well and then link one to the other and the other to the one. Times 300+, basically a whole day of work if my nerves allow.
I was hoping that there was a way, through GREP or through some script, to tell InD to find superscript numbers and make them all anchors and even better, tell it to refer to the same number (or the relative text, after having made a numbered paragraph style for the purpose) in the endnote section and the other way round.
I do not expect a fully automatic solution, but at least something that would minimise the strain on my index finger 
All the best