How to block and unblock https access on OS X 10.9
It is not an answer in regards of the commands you have but a quick solution/workaround might be Little Snitch which doesn't force you to learn the terminal commands - but does need a little work to learn how to engage it selectively. 

It's a graphical tool which makes some people much more comfortable when configuring an application firewall. It also comes with great support and several nice guides for getting started.