find_system('BlockType', 'Gain')

This will list all gain blocks in currently loaded models. to limit to a particulat model:

find_system('testharness', 'BlockType', 'Gain')

From Mathworks.