Hi Tom, thanks for getting back about the numbers.
To get William to leave, click on him & make sure you scroll down the dialogue options by click & dragging down the little slider on the right of the dialogue box - there should be an option to 'Show Item' (its the last one) Click on that & present the box to him again. I can't remember the responses now but a couple of them should prompt him to go to the basement. When he does, go to the left gallery & use the hammer on the nail. Hope that helps - please let me know how you get on!
Just checked the responses: either "Please?" or "Are you really sure of that" should both work!