I'd use a managed switch for that. It should have a decent console or API for scripted automation though, not sure if the one you've linked to does the trick.
You can simulate the physical connect/disconnect by enabling/disabling the switch port using
interface dis/enable or similar.
Additionally, you can configure VLANs and alternately connect one of them to the switch port (as untagged/access). That way you can present various network variants to the test clients. Of course, there may be additional switch features you could use for testing, including variable speed, bandwidth limitations or similar.