In a 6-qt. stockpot, bring 4 quarts water to a boil. Add beans; cook, uncovered, just until crisp-tender, 2-3 minutes. Remove beans and immediately drop into ice water.
In a small skillet, melt butter over medium-high heat. Add shallot; cook and stir until lightly browned, 2-3 minutes. Add garlic; cook 30 seconds longer. Remove from heat. Drain beans and pat dry.
In a large bowl, combine beans, shallot mixture and cheese; toss to coat. Transfer to a piece of heavy-duty foil (about 18 in. square) coated with cooking spray. Fold foil around beans, sealing tightly.
Grill, covered, over medium heat or broil 4 in. from heat until cheese is melted, 7-9 minutes. Open foil carefully to allow steam to escape.