Glad to hear you got out Ok and learned a few lessons. It sounds like you did have options given that you were still close to home and friends to call for help. Now imagine you were 10 or 20 miles in and couldn't free the bike, maybe not life threatening but certainly not a good way to spend the night.
Of course anyone who has ridden has likely been in your shoes, I know I have but that was back when I was a much younger. I remember all to well that sinking feeling with literally both wheels in up to the axles. The worst time was with my XL650 which was a beast even for young me. Thankfully I have not had this happen with the TW, yet that is.