The command you quote shuts down the network connection that goes through the WiFi adapter. If you're ssh'd in via putty, you're essentially slamming the door shut on your own hand.
It appears those instructions were designed to be used when you're directly on the console (i.e. using a keyboard and screen connected to the Pi). On first glance, they appear to be doing substantial mucking around with the network connection (setting up an access point), so it's unlikely that there's a simple tweak to "fix" the instructions to work while you're ssh'd in over WiFi.
If using the console isn't practical, you could hook the Pi up to your network via ethernet, and ssh in that way (much easier if you're using a Pi with built-in ethernet, like a B+, 2B or 3B - if you're using a Zero, there are more hoops to jump through - a hub-with-ethernet like
this or
this would help - you'd only need it for setup).