Power spectral density and SNR for AWGN
First a comment on your noise-generation process. The Matlab function randn() generates Gaussian noise with zero mean and mean power 1. So steps 2 and 3 are obsolete.

If you'd like to achieve a given SNR, then creating the noise signal with the wanted power is as simple as

w = w .* sqrt(P_n)


Where P_n is the mean noise power and can be calculated by the equation you've already found yourself. Actually you're doing the exact same thing in your step 4, from which you can also derive that

P_n = W0 * fs

assuming that fs is the sampling frequency of your system and thus equal to the bandwidth and using Pw = 1.