Saving/loading script fragments?

I apologize if this is an easily solved question, I’m currently overseas and internet access is intermittent.

I’m writing a script within the game engine to simulate gravitational pull between objects. Got it mostly written, now I was just trying to find a way to load variables or lines from other scripts, and save variables or lines to another script (like a savegame file). Any ideas or help? Thanks a ton.