Almost 100 homes in a North Yorkshire fishing village are set to be protected under a “critical” £1.5m scheme.