What do you mean it works with objects transform ? I tried the scripts in an empty project, two empty game objects and those two scripts. There is indeed the non-static error with w, but I got the same with
var t : Transform = Shift.transform;
And it makes sense. Those variables must be used with an instance of the Shift script, meaning :
var shift_instance : shift;
function Update ()
{
var t : float = shift_instance .w; // or var t : Transform = shift_instance .transform;
}