Modifying Hotelling's lemma: Is this valid?
You are basically on the right track but might have been carried away by not writing down function arguments. The profit function $\pi$ has arguments $p$ and $w$; don't drop them.

In Hotelling's lemma, $y$ is the output. On the other hand, you write $y$ for the production function. Let's make things clear by writing neutrally $f$ for the production function. The profit-maximizing input choice is $x(p,w)$, so the quantity produced is $f\big(x(p,w)\big)$, the correct meaning of $y$ in Hotelling's lemma. 

Hotelling's lemma then becomes
$$\frac{\partial \pi(p,w)}{\partial p}=f\big(x(p,w)\big).$$
The profit function is given by 
$$\pi(p,w)=pf\big(x(p,w)\big)-wx(p,w).$$ 

Taking the derivative with respect to $p$ gives us
$$\frac{\partial \pi(p,w)}{\partial p}=f\big(x(p,w)\big)+pf'\big(x(p,w)\big)\frac{\partial x(p,w)}{\partial p}-w\frac{\partial x(p,w)}{\partial p}.$$
This is pretty much what you got there above. 

Now $x(p,w)$ is by definition a maximizer of $pf(x)-wx$. We have the first order condition 
$pf'(x^*)=w$. Therefore, 
$$pf'\big(x(p,w)\big)-w=0,$$
which implies $$pf'\big(x(p,w)\big)\frac{\partial x(p,w)}{\partial p}-w\frac{\partial x(p,w)}{\partial p}=0$$
This reduces our expression for ${\partial \pi(p,w)}/{\partial p}$ to Hotelling's lemma. 

This tell's us also what the important message of Hotelling's lemma is: Indirect effects don't matter. A marginal change in prices has a direct effect on profits since the output gets multiplied by a different number. There is also an indirect effect that comes from firms adjusting how much to produce. Hotelling's lemma just tells us that the latter effect is zero for a profit-maximizing firm, which need not do much adjusting. At a profit maximum, the marginal effect of adjusting production on profits is zero.