After Effects expression - define two positions, tween back and forth
Darby Edelen posted an answer on Creative Cow.


  You won't be able to define any spatial paths any other way, but this
  should work:

d = 5;
fd = d * 2;
p1 = [200, 500];
p2 = [500, 200];
t = (time - inPoint) % fd;
if(t &lt;= d) linear(t, 0, d, p1, p2);
else linear(t, d, fd, p2, p1); 

  
  This starts from p1 at the beginning of the layer and runs to p2 over
  5 seconds, then goes back to p1 and begins again. If you want the
  animation to ease in to each point you could use the ease() function
  instead of linear() providing the same arguments.
  
  -Darby