Detect data entry source (UI, BOI, etc...) in User Defined Script

SOLVED

Is it possible to detect the interface that calls a UDS (i.e. UI, BOI, VI, etc...) and change the way the script behaves because of that? For example, when using the UI, we might want a message box displayed, but would not when using the BOI.

My use case is a sales order pre-write script that needs to behave differently depending on which interface is doing the writing. Has anyone dealt with this kind of customization?