Before I get to your question, there is one important note to make to what you've said in your question. As a non-resident, you are not entitled to free emergency treatment from the NHS. Instead, you may be invoiced (depending on nature of the emergency) after the service and will be obligated to pay it before you can return to the United Kingdom.
If you are interested in learning more, please open a separate question.
As Jeremy Hunt, current Secretary of State of Health announced every NHS trust will have to charge the non-residents upfront for the use of NHS services. Who classifies as non-resident is defined in Immigration Act 2019 s.39. As it is within his powers, granted under National Health Service Act 2006 s.175 (and similar legislation for Wales, Scotland and Northern Ireland), there is no reason to think that they will not be enforced.
Now as a matter of immigration, we have to check Paragraph 320 (22) of Part 9 of the Immigration Rules which states:
(22) where one or more relevant NHS body has notified the Secretary of
State that the person seeking entry or leave to enter has failed to
pay a charge or charges with a total value of at least £500 in
accordance with the relevant NHS regulations on charges to overseas
Seems to suggest that only the actual charges count towards that number. But to find for sure, we must inquire into General grounds for refusal. It once again doesn't mention in any section about the interest in any form, so it sounds rather firm that only the original charges count towards the limit.
It also raises an interesting point:
Refusal on the basis of NHS debt is discretionary rather than
mandatory. You must consider the following before refusing on the
basis of NHS debt:
you must be satisfied that there are no
compelling or compassionate circumstances or human rights
considerations that would make refusal inappropriate because
discretion should be exercised in the person’s favour
Which means that while having NHS debt will most likely warrant a refusal, if there are extenuating circumstances severe enough to counterbalance this fact a person may be granted entry despite the debt.