It looks like the logic that you are using to see if the lines are intersecting is simply comparing the handles to the graphics objects. Remember that (unless you have overloaded it), the line function creates the graphics object and returns a handle to it. That handle contains information about the line, but direct comparisons to different lines will always return false.
It also looks like you have it set to simply set the variable to empty if the lines are equal. This will not delete the line, just change the value of the variable. To delete the line, use the delete method.
Here are some suggestions for ways to check if the line segments intersect. Then you can just check the path line against each wall.
-Cam