Difference between diversity gain and coding gain
MIMO refers to any system with multiple antennas, where signals are transmitted over the same bandwidth and at the same time.

Space-time coding (block or trellis, or a different one) is a specific way to transmit the data symbols. In space-time block coding, symbols are repeated over time and space in a specific pattern, which creates (potentially) both transmit and space diversity. They don't offer an intrinsic coding gain because the information is not encoded.

Trellis codes, on the other hand, allow for a coding gain because not all symbol sequences are permissible. This is similar to non-MIMO trellis modulation, where previous transmitted symbols define a sub-set of the constellation that can be used for the following symbol. This is a form of encoding, with the main benefit of neither increasing the data rate nor the required bandwidth.