Great, going through that by hand is really important.
Once you have a good understanding of the steps, or even
before then, I still suggest using afni_proc.py to write
an analysis script. That gives you something to compare
against, both in terms of ideas for writing a processing
script and in terms of the actual resulting statistics.
The formula that we use for polort, which is applied by
afni_proc.py and by "3dDeconvolve -polort A", is
pnum = 1 + floor(run_duration/150), where times are in
seconds.
For help, see the description of option -polort in
"3dDeconvolve -help", as well as -regress_polort or
even -outlier_polort in "afni_proc.py -help".
- rick