Just make sure that the value of HP relative to DA depends correctly on the current depth.
1) At 1000 DA, value of (losing) 1 DA point is "worth" roughly 0.0005*MAXHP. Each successive point of DA is "worth" slightly more, until 11->10 is worth whopping 0.00488*MAXHP (any DA below 11 is worthless).
2) At 1000 DA, you will reduce damage by 90% (afaik, DA over 1000 actually *does* count for the gauntlet, but I am not sure, so I am assuming 1000 as the max)
3) Therefore, at floor number $lvl, you want at least ($lvl^1.4) HP anyway <-- you probably want to include this as a minimum
4) this means that 1 DA point will be worth at least ($lvl^1.4)*0.0005 score points (if 1 HP is worth 1 score point) <-- this is important for the maximize command
What this means is, at lower levels you will be maximizing HP first, then you hit levels where DA becomes more important than HP, then you hit levels where you max out your DA no matter what and futher improvements are only possible by increasing HP again.
(If you have the stats for that, you can get over 2000 HP just from equipment, which would take you to floor 44 even without any DA, and to floor 227 with 1000 DA)