The Illuminato by liquidware has an example of how to set up a separate area for alternative code bases. See this page:
http://jeefiles.equi4.com/muxshield.pdeWhoops, silly me, I meant this page:
You need to pick a new name and create a copy of the "arduino" folder in hardware/cores/, and twiddle the "boards.txt" file a bit to add a new environment. Then you can make changes to that copy as much as you like and switch to either as needed by selecting the proper board.
Haven't tried this myself. The
sanguino probably also does something like this.