The calculation of the tangent basically looks ok. I don't quite understand the way you draw it, though. If (dx, dy) is your tangent vector, shouldn't your drawing code look like this?
glVertex3f(position, SIN(1, 2, position), 1.f);
glVertex3f(position + dx, SIN(1, 2, position) + dy, 1.f);
In any case, with (dx, dy) being the tangent vector, your two options for the normal vector are (dy, -dx) and (-dy, dx). Remember that the scalar product of the two vectors needs to be zero for the two vectors to be orthogonal. Your normal drawing becomes:
glVertex3f(position, SIN(1, 2, position), 1.f);
glVertex3f(position + dy, SIN(1, 2, position) - dx, 1.f);