Problem when spawning actor to change size

Okay, so I have a game that requires you to drag and drop actors (tenBlock) which are spawned in one corner of the screen into a box (tenBox) so that they overlap. I have lots of behaviors in place that make it so that an attribute (tensCount) will always equal the number of tenBlocks overlapping tenBox. But that is not my problem. Whenever you get five or more tenBlocks in tenBox, they are supposed to shrink so you can fit more in. However, the change size behavior does not change collision size (which is required in my game), and I can not change the self.size attributes without messing up the whole game, due to a bug in Gamesalad which interferes with overlap detection when size changes. Therefore, I am left with the option of changing the size of the tenBlock actors by destroying each one and instantly spawning a different smaller actor (tenBlockSmall) in its place. This part works fine, but I also need all of the tenBlockSmalls to destroy themselves and spawn larger tenBlocks in their places if the number of blocks in tenBox becomes less than five again. This is where things get messed up. As soon as I drag in five tenBlocks, they immediatly start changing to the smaller blocks and back over and over, and tensCount increases and decreases wildly. Does anyone have a better way to implement this spawning function?
Comments
I ended up making separate actors for collision that are invisible to the player and appear at the coordinates of the actors I want detected. Then I made a rule to collide with other actors after they reach a certain size. You could try constraining the coordinates of the collision actor to your blocks then enabling and disabling collision instead of spawning larger and smaller blocks. If you figure out another way, could you post it?