Args there is an error, forgot to add the direction vector. Scalar product gets the projected length of the original direction onto the surface normal and returns only a scalar, not a vector
vecOldDirection - 2*ScalarProduct(vecOldDirection, vecSurfaceNormal)*vecSurfaceNormal
vecOldDirection - 2*ScalarProduct(vecOldDirection, vecSurfaceNormal)*vecSurfaceNormal