Well, it's not ideal, but this might help your on your way.
Edit 1: Among the problems it has-
Some weird behaviors based on the fact that while the cursor is at 15, 15 on a tile, your click-and-drag will be at an odd offset.
Nothing prevents walls from overlapping.
No special handling for walls intersecting
Not using different image for vertical vs horizontal walls once built.