For the Lord himself shall descend from heaven with a shout, with the voice of the archangel, and with the trump of God: and the dead in Christ shall rise first: (1 Thess. 4:16) These are the ones that sleep awaiting a resurrection. Already dead in the flesh, are resurrected (like Jesus) in spirit bodies. Then we which are alive and remain shall be caught up together with them in the clouds, to meet the Lord in the air: and so shall we ever be with the Lord. (1 Thess. 4:17) These ones are changed in the twinkling of an eye. Their fleshly bodies are immediately changed to spirit bodies: You are correct. The text clearly says that the book was opened, and "the dead were judged out of those things which were written in the books, according to their works." This would harmonize with the rulership of Jesus and those resurrected at his coming that would act as kings and judges for a thousand years: It is consistent with that text that the Book of Life would be written during and prior to the millennial reign. Since the payment for sin is death, "their works" (of the resurrected ones) would consist on their life choices during the thousand year reign. Only those that were resurrected from the dead (the unjust) are judged at this point. For the wages of sin is death; (Rom. 6:23) And have hope toward God, which they themselves also allow, that there shall be a resurrection of the dead, both of the just and unjust. (Acts 24:15) The resurrection of the just are those that died faithful and the unjust are those that died in ignorance. Both groups spoken of in the text are resurrected to life on earth during the thousand year reign. The scriptures also indicate that the book of life was started to be written prior to Armageddon as well. In fact, from the founding of the world: Yet now, if thou wilt forgive their sin—; and if not, blot me, I pray thee, out of thy book which thou hast written. And the LORD said unto Moses, Whosoever hath sinned against me, him will I blot out of my book. (Ex. 32:33) Those written in the book who died (before Christ) then they are among the just resurrected. Their names are already in the book of life. Those that died that never had a chance to choose God's side because of ignorance, including those sacrificed to the god of war and other false gods, those murdered, etc., will be resurrected during the thousand year reign and have full opportunity to live and learn the truth without Satanic influence until the final test. These are the ones judged in Rev. 20:12-13.