Although I've never used older versions as I'm quite new into Phonegap/Cordova, Version 3.1 seems to use a slightly different approach for accessing plugins. Following worked for me with Cordova 3.1 and BarcodeScanner.
Install plugin with
plugman install --platform android --project=DIR-TO-CORDOVA-PROJECT --plugin=https://github.com/wildabeast/BarcodeScanner
You don't have to reference barcodescanner.js by your own, cordova takes care of the includes - the example code from https://github.com/wildabeast/BarcodeDemo worked except I had to change the plugin path from
var scanner = cordova.require("cordova/plugin/BarcodeScanner");
var scanner = cordova.require("com.phonegap.plugins.barcodescanner.BarcodeScanner");