Parking rear-wheel first: which sprocket to put rear derailleur in?
You're unlikely to get the derailleur outside the rack with much clearance, so the chances of knocking it getting the bike out again are quite high. It may even be possible for someone to bump the back wheel and bend your derailleur. 

Selecting a bigger sprocket also puts the derailleur further forward. This is likely to improve the clearance around it but of course that depends how your bike sits in the rack.

Cross-chaining into a big ring and a big sprocket brings the derailleur even further forwards, but change out of this when you get going.

You may also want to invest in security skewers and/or an extra lock for your front wheel. Your local bike thieves sound like they have a surplus of bikes without front wheels.