printing variables in formated text?

I could tell you that (and James already did) but bear in mind you probably need to print literals differently from variables for the memory reasons discussed.

... does it free it back up after it prints the line or save it till it does the entire code ...

String literals (like "foo") are copied from the program memory into RAM. They are never freed.

However if you use the PROGMEM library, you can copy them a byte at a time, and only therefore use a total of one byte of RAM to hold them.