I have always taken immodium or Lomotil before I leave to go for my scopes. If my test was scheduled for the morning I make sure I'm up in plenty of time so I can go as many times before I leave. Then about 30min before I leave I take an anti-diahrea pill. It has always helped and I told my GI that I did take it and he was fine with it. Sometimes its the only way to make it to where you need to go.
You might want to check with your DOC first, just in case.