Pietersen, who hit 151, was warned after the umpires deemed he moved into position to play the shot too early.
"The warning was because I was moving my hands before delivery, but it was no issue," Pietersen told BBC Sport.
Jonathan AgnewBBC cricket correspondent
"The umpires were right to warn Pietersen for time-wasting after he attempted a switch-hit. It is up to the bowler to decide when he releases the ball, and I can understand why Tillakaratne Dilshan would not release the ball as KP was shaping up for another switch-hit. If you set your field for a right-hander, and he changes to become a left-hander, you can understand why bowlers would not let the ball go."
"It's a pretty good shot and a scoring option. I'll play that side of the wicket when there's no fielders there."
He added: "There weren't any fielders there so I had to play the shot."
Right-hander Pietersen had already connected with one switch-hit - so called because it involves him switching his hands to adopt a left-hander's grip on the bat - when bowler Tillakaratne Dilshan opted not to deliver the ball as he saw the Surrey man preparing to play the shot again.
When Dilshan aborted another delivery, umpires Asad Rauf and Bruce Oxenford stepped in.
Oxenford explained: "Kevin showed his intention to switch-hit, and the bowler stopped in his delivery stride.
"The directive we have from the ICC for a stalemate like this, when we are wasting time in the match, is to first give the batsman an informal warning.
"If it was to continue, the second occasion would be a formal warning then, on the third occasion, five penalty runs would be awarded to the opposition."
The Marylebone Cricket Club [MCC], cricket's law makers, also contacted the BBC to clarify the ruling on the switch-hit.
It said there was an International Cricket Council [ICC] directive that a batsman can only change his grip on the bat once the bowler has entered his delivery stride, which begins when his back foot lands on the ground.
A spokesperson confirmed that there is no specific law on the switch-hit because the laws have to be applicable to all levels of the game, but that the ICC can issue a strict directive that can be used in elite competition.
Pietersen's stunning innings, which included four sixes and 11 fours, helped England to compile a first-innings lead of 185.
Sri Lanka managed to survive the final over of day three, but they face an uphill task to prevent England from winning the match and levelling the two-Test series.
This page is best viewed in an up-to-date web browser with style sheets (CSS) enabled. While you will be able to view the content of this page in your current browser, you will not be able to get the full visual experience. Please consider upgrading your browser software or enabling style sheets (CSS) if you are able to do so.