Skip sections that have GO
Whether or not you are using SQLCMD mode, you can always avoid the need for a GO (which enforces batch separation) by wrapping the calls in an EXEC().  For example:

IF ($(EnableDBMail) = 1 )
BEGIN
  EXEC('sp_configure ''show advanced options'', 1;');
  EXEC('RECONFIGURE;');
  EXEC('sp_configure ''Database Mail XPs'', 1;');
  EXEC('RECONFIGURE;');
END;


This also works when creating objects that need to be the only CREATE in the batch, such as: stored procedures, functions, triggers, views, etc. The following is a single batch and can be wrapped in an IF or whatever else:

CREATE TABLE dbo.MyTable
(
  Col1 NVARCHAR(256) NOT NULL
);

EXEC('
CREATE PROCEDURE dbo.Proc1
(
   @Param1 INT
)
AS
SET NOCOUNT ON;

SELECT field
FROM   table;
');

EXEC('ALTER TABLE dbo.MyTable ADD Col2 DATETIME NULL;');