Lawmakers in some states have been laying the groundwork to add geothermal power to the electrical grid and pump underground heat into buildings. Now, a technological breakthrough could dramatically expand those ambitions—and perhaps unleash a new wave of policies to tap into geothermal sources.