If the head motion regressors are highly correlated with the tasks (for example, the movement is associated with the tasks), the approach may not be a good idea. If possible, including the motion regressors as covariates is more appropriate.
To avoid the mean being removed from the final result, use -polort -1 in your 1st script.
Gang