You are trying to do something which is very difficult! Do you have a good knowledge of vba?
Anyway here are some hints.#
#1 start by adding a motion path NOT a custom animation
#2 use a VML path not move To etc and change the path of the animation added.
EXAMPLE to move in rectangle shape
Sub RECT()
Dim oeff As Effect
Dim oshp As Shape
Set oshp = ActiveWindow.Selection.ShapeRange(1)
'add existing motion path type
Set oeff = ActivePresentation.Slides(1).TimeLine.MainSequence.AddEffect(oshp, msoAnimEffectPathRight)
'Adapt opath
oeff.Behaviors(1).MotionEffect.Path = "M 0.0000,0.0000 L 0.2000 0.0000 L 0.2000 0.2000 L 0.0000 0.2000 L 0.0000 0.0000 Z"
End Sub
Explaination of Path
M 0.0000 0.0000 Motion Path from current position
L 0.2000 0.0000 Move in Line .2 of slide width right
L 0.2000 0.2000 Line to .2 of slide width across and .2 of slide height down
L 0.0000 0.2000 Line to original left position and .2 of slide height down
L 0.0000 0.0000 Back to start
If you can't' work out how to apply it to another shape I'm afraid you are on your own! I don't have time to do it for you