No problem with storing starsan in a keg, but I always store mine empty and sanitize prior to filling. A sealed empty keg is not sanitary after a while, according to an interview I heard with 5-star. Possibly on Basic Brewing Radio. So I clean mine, rinse them, and store them until ready to fill. Then sanitize and fill. If you're doing it to store starsan though, no problem. But that two gallons can sanbitize a lot of kegs, so if you are storing all of your kegs with starsan in them you're just wasting it as far as I'm concerned. YMMV
Beer line is another story. It's possible that as little starsan as will be in a beer line will be fine, but when I leave hose in a bucket of starsan for too long it starts to break down and get gummy. So again, I clean lines and store them dry, then sanitize prior to use.