Listed school building in Kirkcaldy ravaged by fire was set to be converted into flats