If you touched out at the barriers at Stratford and then back in, you'd be looking at being charged the £9.50 off-peak fare each way. That does, however, rely on you making it back to Langley within the maximum journey time.
TfL doesn't publish the maximum journey times for journeys that involve travel outside the Zones - so I don't think they have any lawful basis to charge them for such journeys, if completed within a vaguely reasonable length of time. But we can guess that they work similarly to the published zonal maximum journey times, of adding 10 minutes per additional Zone. I think you'd be able to go around the Hainault loop within the maximum journey time, but it'd depend on how long you have to wait at Woodford and Hainault for the connections - and at Stratford/Whitechapel etc. for the right Elizabeth line train towards Langley on the way back.
Everything (trains, Tube and DLR) is behind a common gateline at Stratford, so you won't automatically touch in or out when you change there. You have to exit the barriers and re-enter if you want the journey to be 'broken'.
Depending on the exact time you leave, it may work out slightly cheaper to 'split' at Hayes & Harlington (i.e. touch out and back in there) as well as Stratford. It's complicated by the fact that you would pay a peak fare for the Hayes-Stratford journey if you touched in before 19:00, but even with that slight uplift you are still looking at a total cost of £14.50 vs £19.