I don't think JS will let you do that - mainly for security reasons. They want actual keyboad input. However, you can record resetting the rotate tool with this code:
var idslct = charIDToTypeID( "slct" );
var desc4 = new ActionDescriptor();
var idnull = charIDToTypeID( "null" );
var ref3 = new ActionReference();
var idrotateTool = stringIDToTypeID( "rotateTool" );
ref3.putClass( idrotateTool );
desc4.putReference( idnull, ref3 );
var iddontRecord = stringIDToTypeID( "dontRecord" );
desc4.putBoolean( iddontRecord, true );
var idforceNotify = stringIDToTypeID( "forceNotify" );
desc4.putBoolean( idforceNotify, true );
executeAction( idslct, desc4, DialogModes.NO );