As long as the universe has life, this should keep you alive as long as you don't die for whatever reason.
Replace everything with something that does the same thing, and it wouldn't make a difference. Replace another, and then another and so on until you've done it to your whole mind, and you should have a mind that consists of robotic parts that are able to outlive normal tissues.
Do the same with some of your organs, and voilá.
The only problem is that we aren't really able to do that, but in theory I don't see why it wouldn't work.
Basically the boat question where if you were to replace a plan in a wooden boat every year, you'd eventually be able to make the old ship with the planks you removed, but then you have a boat with the same name as the original, because it's arguably the original only it doesn't contain a single piece of the original compartments.
I got this thought from a book which spoke about replacing neurons one by one and then asking if that's really your thinking.