Office-to-residential conversions are notoriously difficult to pencil out. Here's how one developer made it work.