This is an example of pathfinding. Use space key to switch blocks between solid/nonsolid. Try moving your cursor around to move the goal. Yes, it's not perfect.
Thank you to @rovebeetle for helping with this.