just fuse it from the battery ,and use a new clean earth you will have a perm live [ battery ] and an ignition live or acc live, you should be able to find it using a m/ meter , the handbrake light ,like mine , has a mind of its own you say ?
try checking right next to the h/brake under the carpet there is a sensor thingy blob, maybe thats loose. mine is, but im not bothered , at the mo, lol
hth