Integrating out heavy scalars with modified equations of motion: Matching computation of dimension-eight SMEFT coefficients