"It was very tough for me," said Shoaib said after taking four for 36 as South Africa were shot out for 124 on the opening day of the second Test at St George's Park.
Makhaya Ntini hit back for South Africa, taking four for 18 as Pakistan stumbled to 135 for six at the close.
Shoaib said: "It has been the story of my life, being in controversies."
He recalled that the drugs incident led to the third ban of his career after he was twice stopped from playing because of throwing allegations.
"If you asked me the same question (about his career) a few months ago I wouldn't have had an answer that I would play cricket ever again," he said.
The 31-year-old Shoaib gave credit to fellow bowlers Mohammad Sami, Danish Kaneria and Mohammad Asif.
"We worked in partnerships and every bowling spell brought a wicket," he said.
He said he was surprised to have come back so strongly after seven months out of international cricket and nearly a year away from the Test game.
"I thought it would take me the whole Test match to get back into it," he said.
Shoaib prised open the South African batting by taking the first two wickets and was a constant threat, bowling at high pace and exploiting a pitch which offered him steep bounce. He was recorded at speeds of up to 150kmh.
Leg-spinner Kaneria took three for 36 and Asif two for 34 as South Africa, leading the three-match series 1-0, crumbled.
Their previous lowest total against Pakistan was 214 at Faisalabad in 1997/98.
Pakistan seemed headed for a dominating position when they took the first innings lead with only four wickets down but South Africa claimed two wickets in the last two overs of the day, including top-scorer Younis Khan, caught at gully off Ntini for 45.
Kamran Akmal, who shared a 56-run stand with Khan, was out four balls later when he hooked Andre Nel to deep square leg.
"We're right back in it," said South African coach Mickey Arthur, who said his team's batting had been poor on "a fantastic wicket, which ranks with Durban (against India) as the best we have played on this season."
Arthur said the South African batsmen had failed to show application and patience but he was optimistic that they would put up a much better performance in the second innings.
Pakistan captain Inzamam-ul-Haq suffered a bruised shoulder during fielding practice before the match and left the field after the first drinks break.
It meant he could not bat until an equivalent amount of time had passed. He will probably bat at the start of play Saturday but he will only have tail-enders to support him.
"That hopefully will benefit us," said Arthur.