Thanks for sharing your script, Paul!
I do have a question, though. In SSMS, when I bring up the restore dialog, I can select a point in time and then have SSMS generate the restore statements for me. What are the benefits of using your script over using SSMS to generate them?