Those who don't fear darkness… shall be consumed by it!
If you’re not already familiar with advice like “Show, don’t tell” then you should read standard books of writing advice like “How to Write Science Fiction and Fantasy" by Orson Scott Card. I have omitted all advice that is duplicated in standard writing books.
Level 1 Intelligent characters. Writing characters with an inner spark of life and optimization: not characters that do super-amazing clever things, but characters that are trying in routine ways to optimize their own life in a reasonably self-aware fashion.
Intelligence via empathy and respect. You can’t write an intelligent character without putting yourself in their shoes and imagining yourself in their place, which is empathy. Two cheats for writing intelligent characters, then, are (first) to actually imagine yourself in their place, and (second) to start with a character template based on some real or fictional person who you respect.
Thoughtful responses and intelligent mistakes. Every Level 1 Intelligent character wants to toss your precious plot out the window, and will seize any available chance to do so. You must craft their situations so that their optimizing responses drive the plot in the direction it needs to go. If they must make mistakes, have them be intelligent mistakes; ideally, have the reader not see it either on a first reading.
True moral conflicts. Orson Scott Card said that while a Good vs. Evil story can be riveting, it won’t be half as riveting as Good vs. Good. Strong moral conflicts are constructed around moral questions you feel genuinely open about, or by bringing two untainted high ideals into conflict such that even you aren’t sure about the resolution.
Realistic villains and viewpoints. As in Bryan Caplan’s Ideological Turing Test, any realistic villain should be constructed so that if a real-world version of the villain could read your dialogue for them, they would nod along and say, “Yes, that is how I would argue that.” A related principle is that every viewpoint character perceives themselves as being at the center of the universe, and you shouldn’t be able to tell that someone else is really the center instead.
Originality. The key to originality isn’t easy, but it is simple: Don’t Do Stuff That’s Already Been Done. This may require thinking past the first thought that pops into your head. A closely related rule is Don’t Take the Easy Way Out.
Genre savviness. Level 1 Intelligent characters will often have done some equivalent of having read the same books you have, which requires that you give them plots which cannot be solved just by having read similar books.
Level 2 Intelligent characters. The key to writing characters that can exhibit impressive moments of cognitive work is the Fair Play Insight: the background facts must be clear enough for the reader to see, in the instant of revelation, that the character’s genius solution is indeed a cognitive solution; i.e., it must have been possible for the reader to think of by reading the story. There are artifices that can be used to construct characters slightly smarter than you, but these artifices are limited.
Inexploitability. If the character does something novel or unexpected using widely available tools, the surrounding civilization must be such that other people wouldn’t have thought of it already.
Explaining other universes. Part of the logic of writing rationalist fanfiction is that the challenge of explaining or exploiting another universe can feel more natural when we’re not the ones who built that universe.
Solvable mysteries. Thanks to the Illusion of Transparency, the best way to construct a mystery is to have some latent fact about the story, known to you, that is not spelled out explicitly in the text. And then make absolutely no effort to conceal this latent fact, except that you never literally say it out loud.
Real learning. To put real knowledge into a story you must (1) know the actual material sufficiently well, (2) be able to cross-domain transfer and concretely visualize the knowledge for the story situation, (3) master the art of relevance and invoke only those facts such that the story’s plot would be different if those facts were different; (4) translate your knowledge out of standard words and standard concepts; (5) be able to imagine what it feels like to not know the material; (6) practice.
Level 3 Intelligent characters. The strongest impression of character intelligence is made when that intelligence is vivid enough, and real enough, to be contagious to the reader. The secret to this is—
Optimize Literally Everything
The (first) Three Laws of Fanfiction:
Rule Two: Originality isn't easy, but it is simple: Just don't do stuff that's already been done. Even if all of your other characters are going to be absolutely true to canon, you still shouldn't have Harry Potter facing the same three challenges in the Triwizard Tournament because we've already read about them a thousand times. Put in three different challenges. Seriously. It can't hurt. Don't just go through the same events everyone has read about a thousand times before. Writing fanfiction lets you borrow the characters and the world; it doesn't exempt you from needing to surprise the readers and give them something new to read.
Rule Three: The premise of a story is a conflict and its resolution - someone with a goal, which they take action to achieve, and severe obstacles that they must replan to deal with (not just speedbumps along the way), and some ultimate resolution of the conflict in which the people and their situation have changed. "What happens if the Terminator is sent back in time to kill Voldemort" is not a story premise, just a fleeting mental image. "What happens if Harry Potter is under constant attack by shape-changing robot assassins" is still not enough of a premise. "Harry Potter is under constant attack by shape-changing assassins, and by the time he manages a spell to wall off the future he's already learned not to trust anyone" could maybe be a story's premise (though you wouldn't put that in the summary, or tell any reader that until the story had ended). You can change this plan later - but you should at least have one to start with.
So if you have a lovely mental image of Frodo with a lightsaber:
1. Figure out how to make his life more difficult, to make up for the lightsaber.
2. Decide what's going to happen differently in your fanfiction than in the other ones you've read.
3. Know what Frodo wants and what's going to get in his way, and have a plan for how it will all end.