Ye,
In terms of scripting with 3dDeconvolve it is more important to decide how you want to model the hemodynamic response instead of differentiating stimulus types (sustained vs. transient). There are two issues here which might be interdependent with each other: One is coding for all the stimuli, and the other is modeling hrf.
If all stimuli are synchronized with TR and the durations of all stimuli are multiples of TR, you can code the stimuli in files of 0's and 1's with a length of total number of TR's for 3dDeconvolve option -stim_file. Blocked conditions are usually modeled with some standard response function such as gamma variate with 'waver'. For transient events you have to decide the type of basis response functions (gamma variate, gamma variate + time derivative, stick, etc.).
Alternatively you can code your stimuli with their onset times in each file for 3dDeconvolve option -stim_times. You can do this for all kinds of stimuli including blocked and transient events and regardless they are synchronized with TR. Duration of all conditions and basis function type can be specified with this option as well. More details about this option can be found in the following site:
http://afni.nimh.nih.gov/afni/doc/misc/3dDeconvolveSummer2004/
Gang