since you had pain in the right pelvic area and hurts while increasing your intra-abdominal pressure like coughing and sneezing
you may be suffering from impending hernia
mostly inguinal in type. so you can test it by putting right over your right inguinal region (right groin) and feel for any swelling coming out while straining by coughing. If you feel any mass or thrust then consult your surgeon. If it is not then consult an orthopedician for any right hip musculoskeletal problems. The sign that your symptoms getting relieved on laying back suggests that something from inside of your stomach only causing your problem.