This is all explained in the script you attached.
*************
raw data
*************
date/time/group/subject: built in variables that track date and time when script was run with the assigned
subject- and group number
Note: group1/group2 counterbalance the order in which the pairings are run
blockcode: the name of the current trial
blocknum: the number of the current trial
trialcode: the name of the current trial
trialnum: the number of the current trial
response: the final trial response (scancodes of the keys pressed)
Note: script saves the final and -by design- correct response
correct: the accuracy of the initial response
0 = initial response was incorrect and needed to be corrected
1 = initial response is correct
latency: the latency of the final (correct) response
stimulusnumber: the number of the current stimulus
stimulusitem: the currently presented item
expressions.da: d-score of the first blocks
expressions.db: d-score of the second blocks
expressions.d: overall d-score
percentcorrect: the overall percent correct score of initial responses of test trials of
D-score qualifying latencies
Inquisit calculates d scores using the improved scoring algorithm as described in Greenwald et al (2003).
Error trials are handled by requiring respondents to correct their responses according to recommendation (p.214).
...
Greenwald, A. G., Nosek, B. A., & Banaji, M. R. (2003). Understanding and Using the Implicit Association Test:
I. An Improved Scoring Algorithm. Journal of Personality and Social Psychology, 85, 197-216.
You don't calculate an average, not for specific blocks, not for anything else. You can read each row in the raw data file as "this is the D-score given all data available up to and including the current trial". Thus, the final row in the data file holds the final D-scores.