I think I would have tried to get the weight off the front, but until you are in a situation like that, it is hard to know your presence of mind. Sounds like you did not panic and crash like some might be prone to do?
As far as, you should have known not to get stuck, thats true… but there are no perfect rides. My rides to and from work are full of " I could have done X or Y a little better" ,or " I should have noticed Z a little sooner"
Although, for fun I have started riding my FZR off road, so what do I know… Its challenging to ride in a field and over what used to be railroad tracks