I would personally budget a little over two hours to account for any slight variations in run time, as well as exiting the theatre, and the foot traffic getting to the O'Neil theatre.
I actually did something similar to what you're planning; I saw Amelie a few months ago on a Sunday afternoon, and I immediately walked over to the O'Neil to get in the SRO line. I was able to get tickets, but I definitely was not toward the beginning of the line. I believe they have about 25 SRO tickets per performance, and I was just lucky that many of the people in front of me in line only purchased one ticket each. So, it can be done, but I can't guarantee that you will be able to get an SRO ticket!
Do you already have your ticket for Play That Goes Wrong? If not, I suggest maybe rushing that show in the morning (or at noon if it's on a Sunday) for the evening show, so that you can secure that ticket, and then run immediately to the Book of Mormon line for SRO for the matinee. Just a suggestion!