Complex sentence: It retained that role until 1922 when it closed, reopening in 1939 as a Borstal and continued in that role until 1964 when it became a Detention Centre.
Split into simpler sentences: It retained that role until 1922 when it closed, reopening in 1939 as a borstal. It continued as a borstal until 1964 when it became a Detention Centre.