think i got the max number of hearts left with 365 score. found the rat king and jelly king first 2 turns, and got gnome before using a heart scroll, and consequently mine queen too.
I don't actually know the cheat code, but I manage to get 13 hearts left pretty regularly. One key is to take the risk and die (often) rather than take a heart and accept a lower score. The really tough bottleneck is this one point where you are just one diamond short of leveling and you almost always at this point need to get lucky multiple times to get the Gnome.
General strategy is that you have to be aggressive in exploring the map while conserving health, which often means taking a risk rather than playing it safe. If you can figure out places where all neighbors are definitely non-zero, that's good. It means the Gnome can't escape to there. So try to explore in other directions, and don't take the health hit.
I beat the game like every 3-4 tries but only managed to get the highest score 3 times. Having a good early game is the most important thing for highest score. If you have to use a heart scroll before having 8 Max HP it's pretty much over, you can still beat the dragon but you probably won't get 365 points. So you need to find a gold chest and the egg or two chest in the early game and ideally a heart scroll. Everything else like the rat king or slime wizard is nice to have but not really needed