I could interpret some of that a little bit differently. It's less specific to particular duration of singing, but more about the frequency.
- She sang when I ate.
Each time I ate, she sang.
- She sang when I ate for 30 minutes.
She only sang when my eating took 30 minutes.
- She sang when I ate until 7:30am.
She only sang when my eating lasted until 7:30am.
- She sang when I had eaten for 20 minutes.
Once my eating got to 20 minutes she started singing. This is only one that specifies the time in your examples.
There's another way of phrasing these which lines up more with your original question, and that's by replacing "when" with "while" (or "whilst" for the British).
- She sang while I ate.
She sang during the time I was eating: maybe the whole time, maybe less; it's unclear.
- She sang while I ate for 30 minutes.
She sang during the time I was eating, but only for 30 minutes. It's unclear exactly when she started/stopped exactly.
- She sang while I ate until 7:30am.
She sang during the time I was eating, and stopped singing at 7:30am. It's unclear what time she started.
- She sang while I had eaten for 20 minutes.
This one actually sounds more convoluted, and is very unclear. I wouldn't use this.