I don't know about Sigil, but this is what I do in vim:
I use a special symbol (¬, |, ¦ are useful for this) where I want the consecutive numbers:
Code:
<a href="../Text/scriptures.html#scrip¬" id="backscrip¬">This text is a link</a>
Once I have all the links like that, I run this command in vim:
Code:
: let n=1 | g/¬/s/¬/\=n/g | let n+=1
which replaces all ¬ in a line with the number n, and n is incremented by one every time a line with ¬ is found.