A long-vacant site with centuries of history is set for a new lease of life under plans for 160 council flats.