There is extensive documentation on symbolic expressions at
Symbolic Expressions
In particular, some examples treat the difference between setting a variable equal to another variable or constant (as you do in the fourth line of your first block of code) and using the .subs() method which lexically substitutes symbols into an expression. Here's how I used the .subs() method to derive what you are seeking:
var('a h')
f(x) = x^2 - x + 3
t(a) = (f.subs(x=a + h) - f(x=a))/h
t # have a look
t(a).subs(a=1).simplify_full() # we should get h + 1
ta(x) = t(a) * (x - a) + f.subs(x=a)
ta.simplify_full() # optional, to have a look
v = ta.subs(a=1).simplify_full()
v # have a look
v.subs(h=0) # gives x + 2, which is what we want
Disclaimer: I'm learning about all this, myself, so I'm not sure if my result is as general as we would like it to be. I think the .subs method is what you want for doing the kind of algebraic simplifications that are required. In a limit expression such as in this example, we don't want h to go to zero before we are ready!