If a castform used a weather move and then uses weather ball would it get STAB?
Yes. As part of Castform's ability, it changes to that type according to the weather, giving it STAB.