When you die, what contributes to your "Score"?

Score is determined solely by the amount of experience you've collected since your last death. It is not how much experience you have when you die - experience you've spent still counts. For example, if you collect 50 experience, then spend 25 of it, your score is 50, not 25.