This can actually be done with very minimal JavaScript.
Basically the "value" of a Barcode object is changed using the .rawValue property.
Let's say for example, I go to the Custom library and drag and drop the "Address Block" on to my page. I then drag and drop the "Paper Forms Barcode" object from the Standard library on to the same form (not necessarily on the same page).
I then look at the object names of the fields from the address block and I see "Name", "Address", "City", "State", "ZipCode", and "Country".
If you would like the dynamic Barcode to only contain the Name and Address values then you would turn off the "Automatic Scripting" for the Barcode and then in the "Calculate" event add the following:
this.rawValue = Name.rawValue + "| + Address.rawValue;
If you don't need the Barcode to update at the same time the form is being filled out, you can also put the same code in the prePrint event so the Barcode is updated just prior to printing.
Take a look at the following URL if you would like to see it in action:
http://adobe.breezecentral.com/barcodedformsusingrawvalue/