Foem amyas point of view, your loading stuff over and over again ita rather easier just to do the nodes manualy. Go to the source of things then you dont even need to source stuff wich mands it batches FASTER.
you can create the ibl node manualy with createnode and connect it to the ibl manualy with connect attr. its still only 2 lines of code but now your not overdoing it by loading a 1000 line codefragment.
anyway heres a example
CODE
{
setCurrentRenderer mentalRay;
$ibl =createNode -n myIbl mentalrayIblShape;
evalDeferred -lp ("connectAttr -f "+$ibl+".message mentalrayGlobals.imageBasedLighting");
}
im defeerring the creation of the connection to ensure the mentalray ndoes get built on time for the connection.