If you want to allow the 'USB-Mass storage' access while running your application, you could probably reproduce only the source code of the main menu that enables the USB mass-storage access. The irq should not be redirected (the interrupt services that are already in CricleOS should be sufficent).