The idea should work. You can calculate the angle from the ball to the goal with the angle() expression and then calculate a position behind the ball to hit it to the goal with this:

X+radius*cos(ang)

Y+radius*sin(ang)

This is basically all the trig you need for games. For x and y use the ball's position in this case.

So with this you'd move to that position then to the ball. The next issue to address is the car can hit the ball accidentally when moving to that position. To fix it you'd need to move left or right of the ball first.

At this point it becomes a bit tedious to describe but a picture would help a lot.

Basically

Angle2ball is from the player to the ball

Angle2goal is from the ball to the goal

If both angles are Within 90 degrees of each other then move to the point behind the ball

Otherwise

If clockwise go to left point

If counterclockwise go to the right.

I got it working in a capx but I can't post it for a day or so.

Here are the points:

Behind ball

Ball.X+radius*cos(angle2goal+180)

Ball.y+radius*sin(angle2goal+180)

Left point. Right can be found by making 90 positive

Ball.X+radius*cos(angle2ball-90)

Ball.Y+radius*sin(angle2ball-90)

The radius can be whatever looks good. Also I was able to get a more pleasing result by using 135 instead of 90 for the left and right points. I apologize this doesn't cover exactly how to make it work but it should be good enough to get the idea across.