How to render MP4 using After Effects Script with Adobe Media Encoder
Better later than never.

Since After Effects CC 2015.3 (13.8) you can send your comp to AME queue and render it immédiate with the recently used template.

app.project.renderQueue.canQueueInAME --> false is there is nothing to render in AE
app.project.renderQueue.queueInAME(false); --> false = no render, true = render immedialty in AME

Adobe exemple : 

// Scripting support for Queue in AME.
// Requires Adobe Media Encoder 11.0.
{
    if (app.project.renderQueue.canQueueInAME == true)
    {
        // Send queued items to AME, but do not start rendering.
        app.project.renderQueue.queueInAME(false);
    }
    else {
        alert("There are no queued item in the Render Queue.");
    }
}


My exemple of use :

var resultFile = new File(outputVideoPath + outputVideoName)
var renderQueue = app.project.renderQueue;
var render = renderQueue.items.add(comp);
render.outputModules[1].file = resultFile;

app.project.renderQueue.queueInAME(true);


More details : https://forums.adobe.com/thread/2230567