Valuations at non-smooth points Consider the cuspidal cubic $X$ given by $y^2 = x^3$, and let $P$ denote the point at the origin. $V(x)$ cuts out $2P$ and some third point $E$ at infinity, and $V(y)$ cuts out $3P$. 
I am wondering if there is a reasonable way to assign the divisor $P - E$ to $y/x$, even though the local ring at $P$ is not a discrete valuation ring (because if it was the Zariski tangent space would have dimension 1, but $P$ is a singular point on $X$.).
 A: Yes, it is very reasonable to assign to to the rational function $\frac yx$ on $X$ the divisor $1\cdot[P]-1\cdot [E]$.     
The basic fact is that for a local noetherian domain $A$ of dimension $1$ and for a non zero element $0\neq a\in A$ we can define $\operatorname {ord }(a)=\operatorname {length }_A(A/aA)$ and extend this definition to the non-zero elements of the fraction field $K=\operatorname {Frac}(A)$ by $$\operatorname {ord }(a/b)=\operatorname {ord }(a)-\operatorname {ord }(b)$$ thus obtaining a group morphism $\operatorname {ord }:K^*\to \mathbb Z$.
If $A$ happens to be a discrete valuation ring this order function coincides with the  discrete valuation of the ring.
This allows us to define for a locally noetherian integral scheme a group morphism $$\operatorname {div}:\operatorname {Rat}(X)^*\to \operatorname {Wdiv}(X)$$ attaching a Weil divisor to any non-zero rational function
(Notice that Hartshorne only defines this morphism for schemes which are regular in codimension one.)
In your example we get, exactly as  you conjectured,  $$\operatorname {div}(\frac yx)=1\cdot[P]-1\cdot [E]$$
Bibliography
This is all very clearly explained in Fulton's Intersction Theory Chapter 1, 1.2 and 1.3 and Appendix A.3 .
