Hmm, so you have to know a bit about collisions which you can find here: Handling collisions in your game [GDevelop wiki]
To add random forces to the circles, I have already addressed something similar. You can find that here: How do I create a random angle for a force?
Combine them together and you can achieve what you want.
For collisions, make sure the hitboxes are correct for the circle.
To make the box, use line sprites so that each of the line objects can have a collision hitbox and the circle can move inside the box.