The concern is one that a UX designer should take seriously. Don't make the current user experience more smooth at the cost of long-term drawbacks. Don't hide long-term problems from the user (especially health).
But the solution you show is a poor one. It is a repeated obstruction of a user's flow, much like a delete-confirmation-dialog. A likely outcome is that a user will learn to ignore the warning, get annoyed, or get worried when she shouldn't be because the phone doesn't estimate the loudness levels properly.
A large part of the problem here is that the phone-headphone interface is too restrictive for good UX. The phone should know accurately how loud the sound is coming out. And even if we can know the sound levels accurately, a user may want to take the risk of hearing damage temporarily (to hear the details of an important voice mail message over the sounds of a construction site).
As UX designers, we have a responsibility to make sure the user is aware of potential health risks. We are not responsible for the choices they ultimately make, nor should we try to influence them. If the user develops problems because they weren't aware the volume was too high, that's bad UX. If were aware, but they develop problems anyway, it's their own choice, and any attempt to prevent this would diminish the UX.
Some better solutions:
- Extend the headphone plug interface with an (optional) way the headphone can passively supply information about its make and specifications. The phone can match these against an online database of measurements to determine the output level more accurately.
- Color the sound indicator so that it becomes read at dangerous levels.
- Analyse the user behavior. Let occasional dangerous sound levels slide, but send a warning message if you detect consistently dangerous behaviour.
- If the user ignores these, there must be a reason. Maybe they can't hear dialogue over too strong a bass. Expose functionality to the user to fix this if a problem is detected. User testing will let you find out why users have their sound too loud.