Update:
I've worked a bit on coding up a program to do this task. I assume transfer between circular, coplanar orbits with a constant magnitude of thrust for the ship, but allow the thrust direction to change at some time (not necessarily halfway) through the journey. I also assume gravitational attraction between all bodies (Sun, two planets, and ship). Here's an example of going from Earth to Mars, with a constant 0.01m/s[sup]2[/sup] acceleration. Mars starts off leading Earth by 5.42°. At first the ship accelerates at an angle of 0° (+x direction or radially outward) from Earth's L2 Lagrange point, and then after 35.96 days the ship is rotated 190° counterclockwise, with a total burn time of 64.1 days. The end result is to approach within 30,000km of Mars with a Mars-relative velocity of under 3km/s.
This trajectory takes more time (64 days vs. 54 days) than we would predict using the above calculator, which assumes neither gravity nor relative motion between the target and origin. The trajectory is also probably far from optimal for this magnitude of acceleration. To optimize it, we must see what combination of initial acceleration direction, final acceleration direction, time of turn, and total burn time will minimize the distance and time of closest approach, as well as the velocity relative to target at closest approach. Probably the best way to do this is to program a random walker to "walk downhill", finding the location in this 4-dimensional parameter space which minimizes those output variables.