store and restore grid

Hi Guys, how´s going?
does anyone can help me? i need two lines of code, one to store the active grid and another to restore the grid. Here´s the deal, i use a script that needs the home grid to work, but i use a lot grids that i create, so my goal is to temporary sets the grid to home, as the script runs, and then go back to previous grid. I don´t know maxscript, i use maxscript recorder to make my scripts :/
Thanks in advance,

Jsrocha