O’Sullivan won a scrappy opening frame, but world No 80 Lines hit straight back to level at 1-1 with a break of 36.
Lines has endured a tough start to the campaign, the 24-year-old has won just once this season.
A missed black on a break of 38 looked costly, but the Yorkshireman pinched the frame on the final black to go 2-1 up to threaten an upset.
But a missed red in the next frame saw O’Sullivan nip in with an 87 clearance, and that seemed to spark the five-time world champion into action as he moved 3-2 ahead.
And when Lines failed to find the centre pocket with a tricky red, O’Sullivan wrapped up a first-round win.
Fellow Leeds player David Grace lost 4-0 to China’s Zhou Yuelong. World No 1 Judd Trump potted three centuries to beat Blackpool’s James Cahill 4-3.