Ok, so in your wall object, you should store the variable for how many times it has been clicked.
You can do this by first adding a Create event on it and create/set variable "numberOfClicks".
This can be done by adding a piece of code there and putting "numberOfClicks = 0;" inside it.
Or you can simply add a create variable and name it "numberOfClicks".
Then add a Clicked event. In there either add a piece of code again and put "numberOfClicks++;".
Or you can add a set variable enter "numberOfClicks", check relative, and set it to 1.
Lastly in the a collision event with the wall object for your clown object you need to add a piece of code with the following inside:
direction += 45 * other.numberOfClicks;
other.numberOfClicks = 0;
This will increment the direction of your clown by 45 per click on that specific wall.
If you want to set to that angle rather than increment by that angle, change "+=" to "=".
My guess is also you might want to invert the direction of the clown first (so that it bounces right back
if it collides with one that hasn't been clicked). This can be achieved by putting "direction = -direction;"
before those other two lines of code.
I haven't been working in Game Maker for some time so hopefully this works out! :)
Don't hesitate to ask for more info if anything is unclear.