convert batch render functions into maxscript for using into state sets (3dsmax 2012 sap)

I am a maxscript nerd so I post my maxscript question also here
because I need this urgently...

I began to use the 3ds max 2012 state sets and
I realize that I need the scipt code how to insert all
the batch render functions:

how to restore a scene state

how to render in specific resolution

how to save in tif format

thank you all again for any help.