so once you get that working with button released…with reset button

try
cat /sys/kernel/debug/gpio

and hit your usb swich left and right and rerun and verify if gpio-0 or which one

then add similar to button_released section

if grep -E '^ gpio-0 .*) in  hi' /sys/kernel/debug/gpio ; then
            echo "Switch is on right ge4 second press" >> /root/switch.txt
            else
            echo "Switch is off left ge4  second press" >> /root/switch.txt
          fi

so