Quickly turn on / off lock screen?
Turning OFF your screen via widget is possible (and several widgets are available for that). But turning ON the screen cannot work that way, as to access the widget, it must already be turned on. Of course you could use a lockscreen permitting widgets (like C Locker Pro).

An alternative is using tasker, and defining a corresponding profile:


Condition: Headphone plugged
Task: Disable keyguard


This is the most convenient way, as you only had to turn on/off the screen via the power button. And apart from that, you get yourself a powerful companion for your device – just check the tasker tag-wiki and other questions using the tasker tag :)