I've been struggling here a lot. I managed to get 490 Defense on one run through the entry, but whenever I try making any tweak to what I did there, I wind up losing a lot of health. And trying to buy health to compensate erases the gains I hoped to make.
Things I've figured out:
Click here to view the secret text
×If I need more attack than what's laying around the level, the best options in terms of long-term defense gain are, in order, getting it from the altar, spending a green key, spending two yellow keys.
The basic reason for this is that any key is worth +3 defense eventually, so what you're really trying to do is optimize for keys. Consequently, if you have to spend keys before then, it's better to spend one rather than two. (Similarly, this means that it's probably best to get the attack gem over the extra key in 1E on the first two levels.)
This is particularly pronounced in Level 1. If you need +2 attack, getting it from the altar saves four keys over getting it from the main room. Those four keys can eventually be turned into +12 defense on Level 3 - better than the +8 you'd get from using the boost directly, and considering a defense boost on Level 1 is only +3, counterintuitively, getting attack is nine points better than getting defense.
It's not as good on Level 2, but if you need +6 attack, getting it from two altar boosts saves six keys, which translates into +18 defense later - two better than spending those boosts on defense on the third floor. If you spent the boosts on defense instead, you'd only get +10, so this is eight points of defense better than doing that.
There are two main limitations here, however, which is why I haven't been able to turn this knowledge into a win yet. First, if you can get by without the attack, then obviously it's even more efficient not to get it at all. And second, if you wind up needing to spend keys on defense or health, or greckles on health instead of keys, this diminishes the payoff. For a Level 1 altar use, you're still benefiting if you wind up spending one extra key, but on Level 2 this wipes out the gain over waiting (but is still better long-term than taking defense immediately).
So what this amounts to is, while I can see ways to theoretically raise defense long-term, in practice I find that I'm worse off because of the lack of health in the short term.
Details of my best run, which was before I really thought about comparing the altar to spending keys:
Click here to view the secret text
×-Level 1, took three defense boosts from the altar, fought everything except the Mad Eyes and Grey Men before getting the Wooden Sword. I think I wound up spending six keys on attack boosts and I know I had nineteen keys before leaving the level. I could have saved about seventy health by skipping the key blocked by the Mad Eyes.
-Level 2, took two defense boosts from the altar and spent ten keys on defense gems. I ended up killing the rattlesnake before the gel baby and jumping to the next level before taking the sword; this cost me a few keys but it saved me a lot of health.
Don't remember offhand how many keys I had when going to Level 3, just that it was a lot of them.
I avoided killing any mud babies in 2W until I reached Level 3 so that I wouldn't need to spend a green key there to kill everything. It's safe to make two kills to reach a roach queen area and grab the potion or key.
Seems clear there's a lot of room for improvement, especially on the second level. But so far all my experiments with taking less defense (including ones where I take more attack) seem to leave me worse off because I don't have the health to win essential fights.
I've thought about trying to kill the Gray Men on Level 1 before getting the Wooden Sword, possibly even saving a green key by doing so, but the health cost seems prohibitive.
I think the main thing that would help me is a recommended target Attack for the first two levels, then maybe I can wrangle something out of going for that.