This is a pun on "talking in one's sleep", a common phenomenon during slumber and dreaming,  and the author of the Lord of the Rings, J.R.R. Tolkien. If the author were dreaming about being the author of the Lord of the Rings while asleep, then they were "Tolkien in their sleep".
Last night , I kept dreaming that I had written Lord of the Rings . The wife said I ' d been tolkien in my sleep .