Set up a boolean variable called "cursor distance", set it to True by default.
Set up a System event to run every tick, calling check on the distance between your cursor and the wall. If the value is less than 125, the action of this event will set "cursor distance" to false.
On your current event add the condition: Cursor distance=true
Change your current event to an If statement.
This is where I'm going to have to delve into even worse pseudocode, apologies, I'm a bit rushed atm :S
Set the Else to create your plank object at mouse.y+ the distance from wall (Call it from a variable updated every tick?)
Sorry, that went off badly and probably isn't much help! :(
There's also likely a much simpler solution using origin points or something! Sadly I'm new