iTunes pauses and does random things when my headphones move
This problem is related to the microswitch located at the very bottom inside the speaker jack. Whenever you get this problem, make sure your speaker cable is fully inserted into the speaker jack. Even the slightest depress on the microswitch can create interference, causing itunes to start and random songs to start playing. I also recommend bringing your computer to an apple store and getting the speaker jack cleaned, since dust or other contaminants can cause this issue. They can also make sure that nothing is wrong with your microswitch. A friend of mine had to have his motherboard replaced due to a faulty microswitch. This is covered by warrantee as long as your mac isn't too old to be covered.

link: https://discussions.apple.com/message/15803561#15803561