Spot on. Im gonna get a little science fiction-y here, but I think achieving true immortality without going insane would have to require some kind of virtual reality simulation. Like maybe technology advances far enough so we can control our perception of reality to the point where we can experience whatever we choose. After all, reality is just how our mind processes stimuli. We already know our individual realities can be altered. Hallucinations. People see, hear, or feel things that aren't real all the time. So some kind of future technology that allows us to craft/customize our perceptions? Its far fetched, yes, but I believe it's possible.
So say we could successfully create these hallucinations. In time, we could advance the technology to a point where a person can craft their entire life how they see fit (or choose from predesigned realities or something*). Think of it like the ultimate virtual reality game, where you can feel and see everything as if it were real. To your mind, it'd be as real as the world we live in now.
Here's where the immortality part kicks in. Is our perception of time subjective? I dunno. Maybe. But I like to think that if we get that aforementioned virtual reality thing going, we could make it so these simulations last longer in our minds than in reality. We've all had dreams that felt like they went on longer than we slept. I've noticed this especially when I'm knocked unconscious. In the world it may only last a few seconds or even minutes, but the dreams I have can feel like they go on for hours. So what's the limit to how much brain-world time we can squeeze into real-world time? Is there a limit? We could potentially live hundreds or thousands of different lives within our brains, in the time of one real world lifespan. At the end of every simulated life, we could have our memories totally erased.So when we come into the next life, it's a continued consciousness, yet you have no idea and thus no chance for going insane from near-eternity.* But unfortunately, that's all I think it'll ever be. Near-eternity. No matter how many millions or billions of simulated lives we can fit in our brains, it could never be infinite. That just doesn't seem possible. So it's not really true immortality. For that, I have only 2, much less interesting theories that aren't even worth discussing here. Thanks for coming to my TED talk.
*These are spots where I had to stop myself because didn't want to get too off topic, but there are loads of possibilities for this kind of stuff. Pm me if you want to talk more, I love talking sci fi and imaginary technology and shit