The thing is I could write a B5 book without breaking any copyright laws as long as it wasn't published without permission.
Well, first of all, what riyuu was contemplating was
trademark infringement rather than copyright infringement. But to address your point, it's not strictly correct. First of all, if you wrote a book using characters from Babylon 5, again, it's trademark infringement, not copyright infringement. It would be copyright infringement if you used passages of JMS's (or any of the other scriptwriters') dialogue, or passages from any of the B5 novels.
And, you say that it wouldn't be an infringement unless you published without permission. Well, to "publish" is a fairly vague term that could mean a lot of things, but I'm assuming you mean "print books and sell them." Not true. You are infringing on WB's trademark if you write that book using characters from B5, and
distribute it. Distribution means giving out copies, whether you're charging or not. So if you made five copies and gave them to your parents and your handful of best friends, probably nobody would care; but if you printed out fifty or a hundred copies and gave them out for free at a con -- or, if you posted it on a website where people could read it for free -- you've infringed on WB's trademark.
Someone on the LiveJournal B5 community just brought up getting a tattoo of a B5 symbol and wondered if it would be a copyright infringement. Just to clarify, "trademark" generally refers to a word, a short phrase, or a symbol or design or logo (characters fall under trademark). While "copyright" protects original works of authorship, including literary, dramatic, musical, artistic, and certain other intellectual works (the content of scripts fall under copyright).
And, thanks Jan, for your kind words.
Amy