Both. In some scenes, I notice how it distracts me - other times, listening to it gets me into a certain mindset. I listen to the song as long as I need to be in that mindset and once I "notice" the music again, I turn it off. In this way, it's like bad CGI. CGI in itself is a good thing, but if you immediately see that it's CGI and you "notice" it is there, that means it's badly done.
EDIT: It's either a song that plays in the scene (sometimes for real, sometimes only in my head, for example there's a song quite prominent in one of my Webnovels, because the protagonist loves listening to it when he's feeling down, or when he's happy, he will listen to it and sing along; I would listen to this song when he's in such a mood to mirror him), other times, I love (for instance) to listen to Closer by NIN when I write scenes in a certain mindset. It's that low bass that draws me in.