Kite could be used to do this with a proper command file. It can execute command files on shutdown, restart, exiting form usb mode etc.
on your scenario you can copy a proper sh file into the folder of kite whenever it is frozen and you want to open the usbnetwork or just reboot the kindle.
only thing you need apart from the kite is a proper sh file to:
1- (open wifi)
2- switch to usbnetwork mode
3- will delete(or disable) itself.
or :
1- restart the framework
2- remove(or disable) itself
BTW I think there is an alternative to kite also..
EDIT: Found it :
EventHandler could be used in a similar way