You are right about the names being written before the foundation of the earth. Is this all names of all ever born? And would the blotting out be at the end of ones life by rejecting the gospel?
But, your quote here in this post is wrong.
Rev 22:17 The Spirit and thebride say, "Come!" Let everyone who hears this say, "Come!" Let everyone who is thirsty come! Let anyone who wants the water of life take it as a gift!
Right,the Spirit and bride say Come,and anybody can have that salvation,and God says He wants all people to repent,come to the truth,and be saved,and Jesus lights every person that comes in to this world,so people should harmonize scriptures.
It could be that everybody's name is already in the book of life,but can be blotted out by not making the choice concerning the truth.
But I think it is this.God calls things that have not happened yet,as though they already happened,for if it is a plan of God in the beginning to happen in the future,it will surely come to pass with no hindrances.
The Lamb was slain from the foundation of the world.
The prophets blood shed from the foundation of the world.
All the works were finished from the foundation of the world.
The Word was in the beginning,although the Word is God manifest in the flesh,which came in the future,but was considered already in the beginning.
So although they were future events they were still considered as being in the beginning,for God calls things that have not happened yet,as though they already happened.
So the names being written in the book of life from the foundation of the world could be a reference to that,like the Lamb was slain from the foundation of the world,although it was a future event,and all works were already finished from the foundation of the world,although they were future events.
The saints having salvation in the beginning,but God wants all people to repent,come to the truth,and be saved,and the Spirit and bride say anybody can have that salvation,so we have to harmonize scriptures,so the only thing that makes sense is that anybody can have that salvation,but since God calls things that have not happened yet,as though they already happened,it is the same as those that have chosen that salvation have that salvation in the beginning.