You close the lid, Macbook goes to sleep and then you can wake the Macbook using the bluetooth keyboard or mouse. Make sure in System Preferences > Bluetooth > Advanced that the option for allowing bluetooth devices to wake the computer is enabled.
If you don't want to have to wake the Mac from sleep, download Insomnia.
And no, you don't need anything special in terms of configuration or settings to optimise it, other than setting the native external display resolution while only the external display is on. 🙂