Q:

Is NASM 'times' directive taken into account when calculating sizes?

If I have this structure/section:
MyStruct:
    .Data1 dw 2
    .Dats2 dw 3
    times 1000 dw 1
MyStructEnd:

StructSize equ MyStructEnd - MyStruct

Will NASM be clever enough to include in the size of MyStruct the bytes declared in the last instruction or just the first two ones?

A:

Replace times 1000 dw 1 with dw 1 1000 times, which is exactly what it does. Would you expect the size to be calculated properly in the expanded case?
As noted by someone else, you can just try it out:
MyStruct:
    .Data1 dw 2
    .Dats2 dw 3
    times 9 dw 1
MyStructEnd:
%assign    StructSize    MyStructEnd - MyStruct
    dw StructSize                        ; 00 16
%warning    The size is StructSize       ; The size is 22

In case you are unaware of this, you can use any hex-editor to see the output or use assign with warning to see the size while it assembles. It can save you the trouble of waiting for answers.

A:

My apologies. Before Nasm knows MyStruct_size, you hafta do:
; this is just a "typedef"
struc MyStruct
    Data1 resw 1
    Data2 resw 1
    padding times 1000 resw 1
endstruc

section .data
; here, we initialize it
istruc MyStruct
    at Data1 dw 2
    at Data2 dw 3
    at padding times 1000 dw 1
iend

section .text
    sub esp, MyStruct_size ; or whatever

Note: no 't' in the keyword  struc or istruc !

