Maybe you will get a clue from this:
var startRulerUnits = app.preferences.rulerUnits;
app.preferences.rulerUnits = Units.PIXELS; // tell ps to work with pixels
var tempWidth=100;
var tempHeight=100;
var myNewDoc = app.documents.add(tempWidth,tempHeight,72,"exportedLayer", NewDocumentMode.RGB,DocumentFill.TRANSPARENT);
app.preferences.rulerUnits = Units.PERCENT; // tell ps to work with percent
var myNewDoc = app.documents.add(tempWidth,tempHeight,72,"exportedLayer", NewDocumentMode.RGB,DocumentFill.TRANSPARENT);
app.preferences.rulerUnits = startRulerUnits;