It was an attempt to hit the yellow. Nothing more, nothing less. He needed to come twice or three times across the table to reach it otherwise and there was no guarantee of leaving it safe, so his idea was to hit the far knuckle of the pocket, bounce off the black cushion knuckle and hope the ball went somewhere in the region of the yellow. As the commentator rightly said, he was in an awful position.
Total fluke and he definitely did not consider potting the yellow. If he said he did he's a liar. Given the margins concerned it was impressive enough to even hit the yellow.