I don't know much about star trek, but I do know that lovecraft encouraged other people to use his story ideas and never really considered them, or writing at all for that matter, to be a very serious concern. I really don't have any idea how Tolkien would feel about it, but I get the impression that he wasn't all that concerned with publication either, since the majority of the things that he wrote were never completed during his lifetime. As I understand it, he pretty much wrote the Hobbit just for his kids and after it's success the publisher wanted a sequel, which was why he wrote LOTR, which was nearly never published either because he kept revising and adding onto it- eventually ending up as six books, each one about as long as the original Hobbit, and finally completed and published like ten years later.
Yes, that was the case with The Hobbit and The Lord of the Rings, but the reason why he started writing about Middle Earth was to give validity to the languages that he had created. Tolkien felt that for a language to have validity as such it was necessary for it to have stories written in it. Most of the stories about Middle Earth were written for himself or for his literary group, The Inklings. C.S. Lewis' Chronicles of Narnia were also written for the group.