I've been tinkering with a program to layout trail maps from scanned raster maps, called MyGPS http://www.faureragani.it/mygps/indexeng.html
Once the map is loaded, place 2 calibration points, and you can trace-out routes, and place waypoints along the map. Native output is a CSV text, but it has GPX format output as well, but I've had to load/resave it via EasyGPS (a non-map GPX file handler by Topographics.) This might help with the layout of the waypoints, and laying out a dynamic route line. (I've used a simble QBasic program to convert MyGPS native route files to native track files, for outputting as GPX track files, with the traced trail maps.)
Might be just what you're looking for.. Best of all, Free, but you can make a contribution to the author.