Set movetype to MOVETYPE_FLY so it isn't affected by gravity.
Then you can set it's velocity at the speed you want it to travel from A->B.
Then you can calculate how long it will take for it to reach B, and then set the velocity again so that it move from B->A.
Then repeat.