Both players missed multiple match darts before the five-time world champion finally secured his place in the quarter-finals, where he will meet Phil Taylor on Sunday.
The Dutchman led 8-6 in the best-of-17 encounter and had the chance to secure victory in leg 15, but he missed three attempts at double 19.
He then squandered three darts at tops in the following leg, before Thornton pinned double four to break, leaving the Scot throwing for the match.
Thornton looked in control for the majority of the final leg, but Barney's third 180 of the match dragged the Dutchman back into contention and left him handy on a two-dart finish.
'The Thorn' threw a wayward match dart at the bull, giving his opponent the chance to check-out 97. However, Van Barneveld, who averaged 89.93, could not find a treble.
Now it was Thornton's turn to waste match darts at the outer ring, as the Ayrshire thrower failed to check-out 39 with three in hand.
That left Barney with three stabs at tops and, despite being unable to find the red bit in the previous leg, he found the centre of the bed at the first time of asking this time around.