I was actually beginning work on a similar project. Essentially, it's using a combination of the accelerometer and the gyro to get the phone's position in 3D space. That is, when the accelerometer capture lateral velocity, it knows it's moving in a certain direction at a certain speed (until, of course, it receives an opposite velocity, at which point it stops).
It's unlikely to be standard inertial navigation, mems sensors drift with dead reckoning integration pretty quickly, even applying more sophisticated kalman filtering may not improve things indoors without GPS (or sufficient travel for GPS even if you could receive it consistently)... But, if you were to add "room-like" assumptions it might improve things pretty well, eg. when integrating a rotation, fit it to a 90 degree corner, similar with traversal, fit it to travel along a wall. With those basic assumptions, I'm guessing you can correct a lot of the raw integration drift. If this is true, my guess is it would start break down in unconventional rooms - octagonal rooms, non parallel walls, etc...
I wondered about doing something like this a while back - and it was the very quick cumulative error from double integration of acceleration data that stopped me from even trying.
Clever idea getting the user to place the phone on the walls - as you say that would correct a lot of the errors. But also, as you say, unconventional room layouts get you back to square one so to speak.
I haven't played around with the latest generation of sensors, but if the time/distance error growth is small enough, maybe you can get model corrections down to the nearest 45 deg. If you can hit that threshold, you might end up fairly functional with possibly the next largest segment of non-rectangular rooms.
Supposedly, there's a rule of thumb that says that dead reckoning by integrating readings with a MEMS sensor is about as good as walking around with your eyes closed. I didn't even get mine working that well when I tried, but I'm sure it's possible if you get the pre-integration noise filtering right.
Lately I've seen a lot of app notes and open-source code written by/for amateur drone guidance developers, which I suspect would have helped me a lot.