Generalising the question: One of the themes on Rosh Hashanah is that Hashem should remember us for the good, e.g. וזכרנו לטובה ביום הזכרון הזה - Remember us for the good on this day of remembrance.
This would appear to be a bizarre notion, in what way should Hashen remember us for good? Surely Hashem remembers us how we are?
It would appear that we can understand this notion by use of an analogy, let's say you have a point-to-point drawing, but you can join the dots in 2 ways, to make 2 different pictures.
The same applies to us, our lives consists of dots of bechirah (free choice). In order to make a complete picture, Hashem fills in the areas between the dots to create a complete picture of who we are in the universal scheme of things. Hashem can join the dots to make a nice picture of us, or He can join the dots to make a not-so-flattering image.
When we ask that Hashem should remember us for good, we mean that He should form an image of us in the universal scheme of things which is le'tovah, for the best, in the nicest possible way, so that our lives should tend towards the wholesome good that Hashem intends in the universal plan.
Thus, we pray that we should be written in the Book of the Righteous, the sefer ha'tzadikim, so that everything that happens to us should be measured and determined as befits one who is in confluence with Hashem's plan for the world.
As it says in the first berachah in Shemonei Esrei
ומביא גואל לבני בניהם למען שמו באהבה
Hashem brings redemption to their descendants, for His name's sake, [but] with love.
This is apparently the meaning of the notion of the sefer zechuyos, the book of merits.
Once we are written in the Book of Merits, we ask that Hashem should bless us with life etc., in a way that the good that happens to us is in confluence with the ultimate good that is intended for the world.