How National Lottery Heritage Fund helped steer the sector from ‘gravest threat since WWII’ to reopening