The acclaimed writer says visiting young offenders institutions for his new drama left him "shocked".