In weighted least squares, how do I weight the residuals to get an accurate "z score" I am regressing spreads in yield curves in certain countries, in the chart below, the Spanish 2-5-10 spread, against the Italian 2-5-10 spread. 

I want recent data to count more, so I weight the inputs using a decay weighting scheme with a 1 year halflife. 
A "simple" regression line and the weighted regression line are shown. 
I want to calculate the perpendicular distance of the current point (green) from the regression line, in number of standard errors. In the unweighted regression, in R, I will simply say:
> l <- lm(SP ~ IT, data = ss)
> last(l$residuals) / sd(l$residuals)
2013-10-28 
-0.1817122 

Which gives -.18 standard errors away from the regression line. 
How do I do this same analysis for the weighted regression though? I am sure the following is incorrect:
> decay
function(len, halflife, sumone = TRUE) {
#function generates an exponentially decaying series
    t <- len:1 # generate a series of numbers reverse order so biggest weights last
    lambda <- log(2) / halflife #figure out the lambda for the halflife
    w <- exp(-lambda * t) #create the weights series  
    if(sumone) w <- w / sum(w) #normalise sum to 1 if necessary
    return(w) 
}
> d <- decay(nrow(ss), 260)
> ld <- lm(SP ~ IT, data = ss, weights = d)
> last(ld$residuals) / sd(ld$residuals)
2013-10-28 
-0.3667876 

I should surely weight the residuals somehow, before doing the above, is that correct? Could I for example take the weighted standard deviation of the residuals that is:
> last(ld$residuals) / wt.sd(ld$residuals, d)
2013-10-28 
  -0.39717 

where my wt.sd function looks like this:
> wt.sd
function (x, wt) {
    return(sqrt(wt.var(x, wt)))
}

> wt.var
function (x, wt) {
    s = which(is.finite(x + wt))
    wt = wt[s]
    x = x[s]
    xbar = wt.mean(x, wt)
    return(sum(wt * (x - xbar)^2) * (sum(wt)/(sum(wt)^2 - sum(wt^2))))
}

Basically, I want to know how to find the distance from the weighted regression line, in standard errors, accounting for the weights. 
 A: First, just on a side note - your yields (x and y) seems to be non-stationary - you see these 2 clouds on your scatter - they probably happened to be at that particular slope to each other just by chance because yields "randomly walked" in those particular directions. If they would randomly walked in other directions, you could have completely different slope (and you probably will have  in future - something like 3rd cloud somewhere aside). So when you draw a regression line it may happen to be spurious.
Next, one of interpretations of weighted least squares regression is that residuals in your underlying model have different variances in different regions (heteroscedasticity) and you put more weight on where they have smaller variance to obtain consistent estimates of regression coeffs. But then computing residuals' stdev will not be interpretable as an estimate of their true variance - because they come from different distributions with different variances :)
But if you still want some measure of stdev taking into account relative weights or importance of points - then Mean Squared Weighted Deviation may be a way to go.
