Optimal Denoising in Score-Based Generative Models: The Role of Data Regularity