When a piece hits the ground, a point is added for every line you were holding the down button. So, you could probably just take the height difference of the ghost piece and the real piece and add it to the score. Remember to set carry when subtracting =p
I'll bet by directly moving the piece coordinates you bypassed this.