You don't want to put a lid on the wort while it's boiling, because that will trap a chemical call DMS that gives the beer a bad flavor of cabbage or vegetables.
Boil overs are fairly common, I think. Sometimes the stuff kicks up so fast there's nothing you can do in time. I had two boil overs on my last batch, which was my eleventh batch, so I'm still learning to control it myself.
As for topping it off, most extract brewers top off their wort, which is usually around 3 gallons, with another 2-3 gallons of water to get the full volume of 5 gallons. Since you lost some of your malt in the boil over, your original gravity might be a tad low, and the beer will end up a bit weaker, but I'm sure it will still taste fine in the end.