Can you trap gas in your body by swallowing air?

To some degree. Swallowing air is a common cause of belching. Ultimately all swallowed air will either be absorbed or will work its way out one way or the other.