To summarize it:
- If you want to cheat, you can use Mystcraft's /tpx command to escape.
- In SP, you can also go into the "players" folder in the saves and delete [your_username].dat (or in MP, the server owner can do that for you). You will lose all your items, however.
- In SP, if you have world backups, you can revert to a version before you trapped yourself.
If you want to escape completely legitimately, hopefully your age is stable and contains all of the stuff you need to make books to go to new ages. You can still escape an unstable age, if it contains the resources to make new books, but it becomes harder. Decay and meteors (and explosions to a lesser extent) force you to keep moving rather than set up camp near spawn. Meteors and explosions can kill you, sending you back to the age's spawn with no items. Scorched Earth makes it almost impossible to navigate above ground (and also kills off cows). Blindness makes navigation virtually impossible.
- If your age has star fissures, just jump into one. A star fissure looks somewhat like a ravine, but it goes straight down to the void, and you can see a starry effect on the bottom (similar to the end portal, I believe). It will teleport you to your spawn in the Overworld.
- If your age does not have star fissures, you will need to make new books until you find an age that does. However, don't just jump from age to age. Set up camp in your age (a moving camp may be necessary if the age is unstable) and harvest the resources needed to make descriptive and linking books. If your age does not have the resources needed and you don't have the resources in your inventory, you are stranded and you must restart your world.
- Bodies of water, both to fill glass bottles and to spawn squid for ink.
- If you have EE3, a Minium Stone or its ingredients can replace the need of squid for ink if you can find any other dye (flowers/roses, cactus).
- Sand, to make glass for glass bottles. You might still be okay if your age lacks sand, if you have the resources to craft, say, a macerator or quartz grindstone.
- Stone for the ink mixer and a vanilla furnace.
- Trees for wood.
- Sugar cane for paper. If you can't find any, you will probably need some machines to use an alternate paper recipe.
- Cows for leather.
- Wheat/seeds so you can breed the cows.
- Iron for the book binder (to make a new D-Book).
- Optionally, chickens for feathers, for the writing desk.
- Note that only sugar cane/paper, leather/wheat, and ink are needed in potentially unlimited amounts (depending on how lucky you get). Everything else is a one-time cost, so if your age lacks the resource but you have the items needed in your inventory, you are okay (unless the infrastructure gets destroyed by, say, a spontaneous explosion). You will want to make a book binder and ink mixer. Make two link panels and make a linking book and descriptive book. Link to the new age. If it is dangerous or a void age, link back immediately (if you die you will be trapped in that age). Otherwise, explore a bit and see if you find a star fissure. If not, link back. Repeat until you find a star fissure.
- If you don't want to keep rolling the dice with new ages, search for libraries (or villages) until you find the Star Fissure page. You might get lucky, or you might need to go through many libraries before you find the page. You can also make random ages and loot the libraries there too, or hopefully luck out and randomly get star fissures. When you do find the page, either copy it with the writing desk, or just use it straight up along with the other pages you find to make a new age book if you can't find a single feather. Go to the new age (bring a linking book just in case you made a mistake writing the age or almost die), find the star fissure, and jump in.
- Alternatively, if your age has strongholds, find one and complete the end portal as in Vanilla. You will need eyes of ender, but since you can't use the nether, you will need an alternate source of blaze powder (e.g. cinderpearls from Thaumcraft) or else this strategy won't work. I'm not 100% sure if End Portals work in ages, though, as I've never tried it. It does not create a new End - it will be the original End and you will need to kill the dragon if you haven't beaten it yet. I don't know what happens if you die in the End after entering from an age. I don't even know if the exit End portal will take you to the Overworld or your Age (if you are using this strategy, I suggest not to sleep in the age).
There is no certainty that you will be able to return to the Overworld (without cheating). Certain ages just don't have the resources needed to make new books, and unless you have those resources on hand, you won't be able to go anywhere. A void age is completely devoid of resources and you will be trapped forever. An endless desert will lack trees and animals, screwing you unless you have wood on hand and either a stack of leather or two cows in safari nets along with wheat seeds and dirt (dirt may be found underground). A dry age (no water) will leave you without squid as an ink source and no water to mix the ink, along with no sugar cane. A single water bucket will at least let you fill water bottles to make ink bottles if you have ink on hand. Two water buckets will allow you to make infinite water. Otherwise, hope you find the ingredients for the Aqueous Accumulator or some other item that creates water. An age with no stone (e.g. Netherrack or Endstone base, which also means no iron ore unless you also have meteors) will prevent you from making the ink mixer or a furnace unless you have stone on hand. An infinite ocean will lack trees for wood. An age with absolutely no sand will mean no glass unless you get a grindstone or macerator or have glass on you. No tall grass means no seeds which means no wheat to breed cows (unless there are villages or some alternate source of seeds).