I'm not really sure how long I was in there. All I know is that I didn't come out from the toilet before/until I'd thrown up four times.
Should I use before or until? (I third option is also welcome).
Here is a chart of uses
Event-1 until Event-2:
Event-1 continues up to the time when Event-2 begins.
Event-1 before Event-2:
Event-1 occurs prior to the time when Event-2 begins.
Not Event-1 UNTIL Event-2:
Event-1 occurs just at the time when Event-2 begins
Not Event-1 BEFORE Event-2:
Event-1 occurs at any time after the time when Event-2 begins.
So if you are using until you are saying something like
Immediately after I peed four times, I left the bathroom.
And with before
I left the bathroom sometime after peeing four times
It depends on the context
I generally wouldn't use I didn't come out before because it is a bit confusing. If that is what you are trying to convey I would use:
I'm not really sure how long I was in there. All I know is that I finally made it out after peeing four times.
It is all up to preference though