You may use some code like this:
RC_PATH="~/.myscriptrc"
echo $var1 > $RC_PATH
echo $var2 >> $RC_PATH
var1 and var2 will be separated by a newline and stored in the ~/.myscriptrc config file. So, given var1=Foo and var2=Bar, the ~/.myscriptrc file will be:
Foo
Bar