there's a global procedure called performFreezeTransformations within a .MEL file of the same name and receives the following arguments:
// Input Arguments:
// 0 - Execute the command.
// 1 - Show the option box dialog.
// 2 - Return the command.
I think that's the easiest way. You can check out the MEL file to see what it does, otherwise, you'll probably get the results you need by executing:
performFreezeTransformations(0);
Hope that helps.
Alec