I always thought of it as "What (is) (for) me to do?", where the dative is either translated "to someone" or "for someone". i.e. "открыть кому-либо дверь"

Similarly "What am I to do?". If you stop to think of this phrase... There's strangely little driving it.

It's interesting to ponder why such phrases manage to form in languages so commonly... Shortening down more fleshed out constructions is a possibility... But perhaps we are striving to create some sort of phrase that uses an altogether different mood/tense/aspect (hence the unconjugated verbs in both Russian and English, since neither language necessarily has a true ending to represent this theoretical mood). Perhaps this is "the Obligatory Mood".