Hi Kevin,
If a soft code handler function is receiving bytes from the state, you can store your data on the line after you trigger TDT.
You don't need a global variable to move data from the soft code handler to your protocol for storage. simply do:
function My_SoftCodeHandler(inByte)
global BpodSystem
MyJitterVariant = calculateMyJitterVariant(); % where calculcateMyJitterVariant is a function you wrote
triggerMyTDT(MyJitterVariant); % where triggerMyTDT is a function you wrote to trigger TDT
BpodSystem.Data.JitterVariants(BpodSystem.Data.nTrials) = MyJitterVariant;
Any field you add to BpodSystem.Data (for instance, a vector of jitter variants) will be stored with your session data.
I hope this helps!