Have a look at my online demos for Independent Randomisation and also Trial Switching for a method of loading trials in a code component.