A simple script to add a defence layer against BadUsbs (eg. rubberduck), by hijacking HID device connection and disabling it until a predetermined sequence of keystrokes (in case of a keyboard) are sent by the device
It looks from the code that you are trying to implement a finite state machine in order to block or unblock the USB ports. As you are doing it from scratch, the code is a bit unreadable and harder to follow. Perhaps, you could use an explicit state machine library to abstract this behavior in an object-oriented way.
Docopt is a nice pythonic way of parsing input parameters in a standard and well-recognized way in the community whilst providing both: a nice docstring as well as a usage string to the users at runtime. Perhaps, it could be a good idea to use docopt instead of the regular opt parser which might be prone to errors due to string manipulation and adds redundancy in your code due to the need to print the usage string again.