Modifying Hotelling's lemma: Is this valid? Hotelling's lemma is stated as:

$$\frac{\partial \pi}{\partial p}=y$$

knowing however that on the more basic level, output $y$ is determined by the input(s) $x(p,w)$,let the profit function be defined as:

$$\pi=py(x(p,w))-wx(p,w)$$

taking the derivative with respect to $p$

$$\frac{\partial\pi}{\partial p}=y(x(p,w))+p\frac{\partial y(x(p,w))}{\partial x(p,w)}\frac{\partial x(p,w)}{\partial p}-w \frac{\partial x(p,w)}{\partial p}$$

Wouldn't this be a more accurate definition of hotelling's lemma?

I'm speculating considering some of the critsisim I read on hotelling's lemma in applied work. Namely: Duality, Optimization, and Microeconomic Theory: Pitfalls for the Applied Researcher
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.