Translation:I have needed to go to the hospital for a long time.
how does this mean "I have needed to go" instead of "I need to be".
It's an accusative case. «В» + accusative expresses the final point of movement.
To be would be «Мне давно́ на́до быть в больни́це», and you cannot drop «быть» in such case.
‘I have been needing to go to the hospital for a long time.’ – This is what I wrote, but it was not accepted. Can you say ‘have been needing’? I am not entirely sure myself.
"I have needed to go" - does not sound right. I should be" I needed to go to the hospital for a long time".
this construction does not work in english, I have needed to go, just don't work. normal people would use "I should have been to the hospital a long time ago" or "my visit to the hospital is long overdue", but the phrase you are using is grammatically wrong, the other option is "I have been needing", but again, no one would use it.
So how would you distinguish between this and "I need to go to the hospital for a long time"? (i.e. I am about to go to the hospital and I will be there for a while)
"Мне надо в больницу надолго", or "мне надо надолго в больницу". The key word is "надолго" wich means "for a long time", while "давно" means (depending on context) either "long time ago" or "since long time ago 'till now" and the latter meaning is used in the Duo's sentence (English renders this meaning through using Present Perfect)
Yes, «Я давно делаю упражнения» is OK.
Although «делаю упражнения» is not something I’d say: I’d specify what kind of exercises you do, e.g. «я давно делаю заря́дку» ‘I’ve been doing morning exercises for a long time’ or «я давно́ де́лаю упражне́ния из э́той кни́ги» ‘I’ve been doing exercises from this book for a long time’. Without some context, just «упражне́ния» sounds strange because there are a lot of completely unrelated activities described by this word (e.g. physical exercises and language exercises have little in common).