Hi Chris,
You can define model-level logic that is shared across several forms with the oxf.fr.detail.model.custom property. If you can write the logic you're talking about in XForms and run it on xforms-ready (or xforms-model-construct-done), then this should do exactly what you are looking for:
https://github.com/orbeon/orbeon-forms/wiki/Form-Runner:-Custom-Model-LogicAlex
--
Follow Orbeon on Twitter: @orbeon
Follow me on Twitter: @avernet