help to animate an lower thirds that's positioned by expressions
There are some built-in functions just for this purpose. You'll find them in the interpolation folder in the expression drop-down. The simplest is the linear() function:

linear(t, value1, value2)


This function interpolates in a linear fashion between value1 and value2 based on the value of t, where 0 ≤ t ≤ 1. So if t=0 the function returns value1 and if t=1 it returns value2. It can also take five parameters, in the form

linear(t, tMin, tMax, value1, value2)


in this form, instead of using the range 0-1 for t it uses the range tMin to tMax.

Along with linear() there are also ease(), easeIn() and easeOut(). These interpolate with easing - meaning the animation slows down at the beginning or end, or both.

So in your example you could add this before the last line:

startTime = inPoint; //if you want the animation to start at the start of the layer
m = ease(time-startTime, 0, animationLength, 0, m)


this will smoothly animate from the layer's in-point for animationLength seconds to the calculated position.

Oh, BTW it's Javascript not Java. They are completely different languages. As they say, Java and Javascript are similar in the same way that "car" and "carpet" are similar.