Hmm, I took a look at your code.
You're over-complicating things
There's no reason to have a frame to parent your unitframe to, that does nothing.
You should just create your Button from 'SecureUnitButtonTemplate' as you've done, set your attributes and then use RegisterUnitWatch(yourframe)
It will take care of showing / hiding of itself (look at how the default target frame is done for example)
You don't need that 'w' frame you have at all.
Here for an example:
http://www.wowpedia.org/API_RegisterUnitWatch