Creators: The team over at HASHBANG Productions
Plugication is a free and open-sourced jailbreak tweak that plays music right when the headphones are plugged in. I updated this tweak for the latest versions of iOS and implemented some nice settings.
The code is open sourced for others to learn from. Available on Github.
When you disconnect headphones from your iDevice, it pauses the music, but it doesn't start playing when you connect them. This tweak does exactly that.