Wiring power supply, battery and charger for portable speaker
To implement 2) break the vertical wire above the battery -pin (above the first junction).  Then reconnect the upper wire to the charger jack pin that you labeled as ???.  So now when you insert the charger plug the battery -pin will be disconnected from the upper circuit, and when you remove the charger plug the battery -pin reconnects to the upper circuit.  (See revised circuit below)

Your drawing does not show any over charge protection for the battery.  If you are going to use a Li Ion battery this is absolutely required.  It may be best to just buy a battery assembly that already has a protection/charging circuit built in. For most any other type of battery you should still have some minimal over charge protection, either directly in line with the battery or in the charger module itself. What ever battery type you use be sure to read the manufacturer's recommendations for properly charging the battery. 

Lastly be absolutely sure that the Power Supply and the Charger you use are simple isolated types, with no common earth ground.  Since you are switching the ground pins in the circuit you do not want any extra ground paths making a connection.  After assembly carefully test the circuit to verify that the battery connects and disconnects properly.