Nanoengineering a single-molecule mechanical switch using DNA self-assembly