Hi,
I'm a little bit confused about your code but I'll try to explain what you should do when you try to de/activate some functionality with buttonclick ...
Connect your button button with onclick handler for the map ... e.g.:
<button onclick="javascript: eventhandle = dojo.connect(map, ev, fun)">
fun = function(event) {
//place business logic here => e.g. doBuffercode
dojo.disconnect(eventhandle); //disconnect this evenhandler => only one buffering is done ... you can place this line of code on antoher button or wherever you want to trigger the deactivation
}
The code you wrote doBuffer.deactivate() should do nothing because doBuffer is a function itselfe and not a object you can call a function on. In the esri example the activate() and deactivate() functions are called on the drawtoolbar object. I think you mixed those things up.
Hope that helps .. if not post more of your code.
Greets Tol