Hi Sebastian!
You have many ways to this I guess. Here is what I would do with my little knowledge ^_^ :
-You could set the Square's solid disabled as soon as the player is overlapping it, and enable it back if the player is not, but it would also allow the enemies to pass as long as the player is passing on it, so it might be stupid.
-You could "bump" out enemies on collision with the square if it is not solid by using the "Set Vector" platform action or even more dirty by reseting there position to self.X-20 if they are on the left (20 is an example here) and self.X+20 if they are on the right side of the object.
If you send me your CAPX project I can try to build something and send it back.
Vega