In the episode Scandal in Belgravia, after Irene Adler drugs Sherlock and escapes with her phone, Sherlock wakes up in his bed, and receives a text message from Irene Adler, with a sexual mourn set as his message ringtone. Surely this was the work of "The Woman", but my question is how did she do it?
When she returned his coat to him, at Baker Street, whilst he slept.
Sherlock arrives at Irene's and sits in her reception room after taking off his coat and seeing it beside him. He then proceeds to rescue the situation that develops by correctly opening the safe, using Irene's measurements, and helping her evade the CIA. This appears to put all the power in his court, as it shows him as the usual, saves-the-day genius.
However, when they get upstairs, Irene quickly drugs him and as he passes out, they both appear by the car of the case John was investigating. Although Sherlock knows what happened, Irene surprises us by being able to walk us through what had happened - a man went to a river, threw a boomerang and was spotted by another man in a broken down car. That other man then tried to start his car and his engine blew out, distracting the first man and causing the boomerang he threw to strike him in the head, killing him.
Suddenly, we see how perceptive and strong Irene is. She was happily rescued from the CIA by Sherlock, only to immediately turn the tables on him and demonstrate she has his reasoning and deduction prowess in her solving of the boomerang case.
Whilst this may all seem unrelated to the question you ask, it's vital as it shows her intelligence (and agility, given her timely escape out the window). As pointed out already, there was no time for her to set his ringtone after he collapsed, as John came in. However, we see later on Sherlock sleeping on his bed, with his blanket around him, and Irene appearing over him, almost in a dream, saying (around the 36:00 mark):
Hush now. I'm only returning your coat.
Therefore, she clearly returned to her house at some point, got Sherlock's coat, then managed to climb in Sherlock's window and return it, along with his phone and its now jazzed-up ringtone. How did she do all this? Because she's both agile and intelligent, as the scene in her house demonstrated.
I found a clip of the scene in question. Irene's appearance at the end confirms her presence in Sherlock's apartment.
When John was distracted by Irene's nudity, Sherlock gave her his coat, which had his phone in it. She had it on when she escaped. During the time she was missing and Sherlock was drugged, she changed his text tone for her, snuck into Baker Street, and hung his coat on the door, whispering to him that she was returning it. He woke up, she was gone, and after John forcing him back into bed, we see his jacket, the pocket lights up, and it moans. Ta dah.