489. – Then when he says, then said I: Lo, I come, he continues to approve the New Testament. According to a Gloss it is read in the following way: Then, namely, when you did prepare a body for me, i.e., in the conception, I said: Lo, I come, i.e., I propose to come, namely, to the passion: 'This is he that came by water and blood, Jesus Christ' (1 Jn. 5:6). Or it is better referred to His coming into the world, thus: Then, namely, when holocausts were not pleasing to you, I said: I come by the Incarnation: 'I came forth from the Father and am come into the world' (Jn. 16:28), and this in orde...r to offer myself in the passion; therefore, he says, Lo.
490. – But was that sacrifice accepted? It certainly was, because in the roll [head] of the book it was written of me. This book is Christ according to His human nature, and in it were written all the things necessary for man's salvation: 'Take you a great book' (Is. 8:1); 'And the head of Christ is God' (1 Cor. 11:3). In the head of the book, i.e., in the plans of God, Who is the head of Christ, Who is the book, it is written that the Son of God is to be incarnated and die. Or, the book, i.e., the Psalter, whose first psalm concerns Christ. Or better, the book of life, which is nothing else than the knowledge God has about the predestination of the saints, who are saved by Christ. Therefore, in that book it is written of me, because the saints are predestined by me: 'He chose us in him before the foundation of the world' (Eph. 1:4); 'Whom he foreknew, he also predestinated to be made conformable to the image of his Son' (Rom. 8:29). Therefore, if predestination is called a book, it is obvious that Christ is the head of the book: 'They that are written in the book of life of the Lamb' (Rev. 21:27). Therefore, in the head of the book, i.e., in me, according to my divine nature, it is written of me, according to my human nature, I have come to do your will, i.e., this was foreordained that by Your grace I should do Your will, by offering Myself for the redemption of the human race.
Source: Commentary on Hebrews