In pretty much most pedals nowadays, if a pedal is run on batteries, when a jack is inserted the unit turns on and when unplugged, turns off. How is this achieved?
Nope, that's what you use a jack with two rows of contacts for. Looking at the picture of the stereo jack a little up the page, you'll see that the contact fingers touch the second row of terminals when there's no jack inserted. So, what you'd do is, you'd wire the output of the amp to the "tip" contact on the jack, and wire the speaker to the tag opposite. When you put the plug in, the tip of the jack lifts the contact finger off the other terminal, breaking the circuit with the speaker.
A long long time ago, you could get gauge B jacks (used in some patch panels, and old telephone exchanges) that had little pushrods that operated switches with NC and NO contacts when a jack was inserted.