I've never been turned away no matter how long unless the ride breaks or needs to be stopped for safety reasons (lightning for example). They do not restart the ride if something happens after closing time and everyone is asked to exit the ride. I've never been in line more than 1 hour after the advertised close time and that was 7dmt that said 90 minutes when I stepped into line.
You also need to know what happens to the ride normally. For example TSMM used to be in the fall out zone for fireworks so it would close much earlier than park close because it had to be cleared, including getting everyone out of the area to have the night show. That's not the case anymore as they did some construction to move the fireworks outside the park but it's good to know the operating hours of the ride as something with multi-hours of waiting may not close with the park so they can clear it within 1 hour after the park close time.
It's a great technique for 2 reasons. 1 is you don't waste any other time in the park for that really long line ride. The second is you get a fairly empty park to casually walk out of taking some amazing pictures without photo bombers. Just keep in mind what your next morning works like, some days your talking about leaving the park about 3-4am plus the travel to the resort which will be very direct but they go down to 1 bus stop and call in buses as they need them.