Having never written a traditional book for a musical before Sunday — and having seen few musicals — working with Sondheim became my education.