You don't need to program anything- determining if you're in autonomous or not, is determined by the oi's competition port. You'll have to make an autonomous switch. A diagram of the competition port can be found here:
http://www.ifirobotics.com/docs/comp...guide-reva.pdf
Or you could just buy one from andymark:
http://www.andymark.biz/am-0016.html