I'm about to buy a property on which my neighbor has a right-of-way that gives him access to his electricity meter, which is installed in an outbuilding. This building is currently open, but could I close it off?

Yes. In principle, nothing prevents you from enclosing the building, unless otherwise stipulated in the easement deed. If this is not the case, article 701 of the French Civil Code prohibits the owner of the servient land from "diminishing its use or making it more inconvenient". So, if you decide to close the gate, you'll need to give your neighbor a key.