Held in custody here is not a modifier at all, neither an adjectival nor an adverbial. It is the predicate of a passive infinitive clause which has been ‘reduced’ by omitting the infinitive to be.
That has a lot of technical terms you may not be familiar with, so let’s look at how the clause “It wants people held in custody” is built, step by step.
First: the head clause here is
... it wants X.
X, the Direct Object or ‘object complement’—what it wants—may be represented by an independent clause in the passive voice:
People are held in custody.
In this particular context, want ‘licenses’ (permits) two ways of ‘complementizing’ this clause—turning it into a form which can act as an object complement of the verb want. You must turn it into an infinitive clause with a verb cast into the marked infinitive form, but the clause may or may not be headed with the ‘complementizer’ (traditionally called a ‘subordinating conjunction’) for:
... people to be held in custody OR
... for people to be held in custody
In this case, the author has selected the infinitive clause without for (the for form is actually pretty rare with want):
... people to be held in custody ...
The final step is ‘reducing’ the clause. In this subordinate clause the to be piece may be omitted from to be VERBed
... people held in custody...
This is married to the head clause as X, the Direct Object:
... it wants people held in custody ...
And now that is integrated into the sentence as a when clause:
... when it wants people held in custody.