Good question. Looking at this from the controller's perspective. The squawk code allows the controller to identify position. Once he knows the position, he can make sense of your further requests and can probably process the request "on line". The alternative requires more exchange of messages.
Therefore I would place priority on setting the squawk. Then continue with ATC. Even at the risk of another station interrupting the dialogue.
flyme