Is Granger causality analysis a linear operation?

(1) The correct calculation method should be as follows: Granger connection is computed for each trial, and the average Granger connection matrix under the experimental conditions is obtained by averaging all trial connection matrices. Am I right?

Yes, But you need to subtract the average signal (ERP) of each condition from their corresponding trails before computing the connectivity. We have this option in Brainstorm (remove evoked response).

.(2) In addition, for Granger causality analysis, is the length of stimulation signal of 5S long enough (equal to the length of ERP)?

It depends on your sampling rate and other factors, like how many parameters you have, but roughly should be okay.

(3) If the length of 5S is too short for Granger connection analysis, is it impossible to use Granger analysis method? Is there any time requirement for other connection methods?

Since you have 30 trails it should give you an acceptable SNR.