Despite many advances in the use of DNA nanodevices as assembly or disassembly modules to build various complex structures, the simultaneous assembly and disassembly of DNA structures in living cells remains a challenge. In this study, we present a modular engineering approach for assembling and disassembling DNA nanodevices in response to endogenous biomarkers. As a result of pairwise prehybridization of original DNA strands, the DNA nanodevice is initially inert. In an effort to bind one of the paired strands and release its complement, nucleolin competes. Assembly of the DNA nanodevice is initiated when the released complement binds to it, and disassembly is initiated when APE1 shears the assembled binding site of the DNA nanodevice. Spatial-temporal logic control is achieved through our approach during the assembly and disassembly of DNA nanodevices. Furthermore, by means of this assembly and disassembly procedure, the sequential detection and imaging of two tumor markers can be achieved, thereby effectively reducing false-positive signal results and accelerating the detection time. This study emphasizes the simultaneous assembly and disassembly of DNA nanodevices controlled by biomarkers in a simple and versatile manner; it has the potential to expand the application scope of DNA nanotechnology and offers an idea for the implementation of precision medicine testing.