As the market maker is supposed to be long BTS at all times, I guess when you say "If the market maker runs out of BitUSD" you actually mean "If the market maker reaches the limit of the amount of BitUSD it is allowed to create". Is it correct?
Yes, the marker simply has reached it limit of the amount of BitUSd it is allowed to create. BitUSD can be attained through other means, the market maker is not the only player in the BitUSD market. If a customer receives BitUSD from another neutral party then they receive the same benefit as if they had acquired the USD from the market maker. If the customer receives BitUSD from someone that does not maintain a neutral long BTS position, then their BitUSD is just back by the collateral from the BitUSD contract (the collateral provided by the short)
When you say "Your deposit is thus held by the market maker until you claim it [back]" this contradicts the assumption that the market maker is BTS long at all times.
And what happens when I decide not to claim back my GATEWAY.USD via the bot and instead choose some other way to get rid of the bitUSD I got from the bot? Won't the bot be stuck with the GATEWAY.USD it originally bought from me?
The market maker is long BTS because it only trades the borrowed BitBUSD for GATEWAY.USD. At all times it holds the balance of the BitUSD loan held in BitUSD and USD (from one or more gateways).
If someone sells their BitUSD by other means, the market maker's position doesn't change. Someone else that would like to redeem their BitUSD through one of the gateways, that the market makers holds IOUs from, can do so through this market maker. If the market maker believes that its inventory of a GATEWAY1.USD is unwarranted given the demand to redeem GATEWAY1.USD then the market maker can either exchange GATEWAY1.USD for GATEWAY2.USD (assuming that there is more demand to redeem GATEWAY2.USD than to redeem GATEWAY1.USD) or it can redeem GATEWAY1.USD and deposit to GATEWAY2 and thereby receive GATEWAY2.USD.
if there were a perceived imbalance in the flow of capital from a particular gateway (i.e. people deposit to this gateway but make withdrawals elsewhere - this might be relevant if the gateway provides a remittance business) the market maker could either not purchase IOUs from that gateway or it could find a complementary gateway (one where the capital flows are opposite - more people withdrawing than depositing) and provide the aforementioned process of exchanges GATEWAY1.USD for GATEWAY2.USD or converting GATEWAY1.USD to GATEWAY2.USD (i.e. redeeming GATEWAY1.USD and depositing to GATEWAY2)
Additionally, the capital that the market maker is using for its operation is an endowment from Bitshares (the committee). It is meant to be used only for this service. Thus, the market makers orders can sit on the books indefinitely until they are executed. There's no consideration for better places to allocate funds. There is never a point that the market maker is 'stuck' with GATEWAY.USD, because it has no intention of settling its BitUSD loan, except through margin call liquidation at the feed price. The BitUSD loan can remain outstanding so long as the market maker continues operation.