The playwright takes a break from rehearsals to discuss writing about children in the Scottish care system - and explains why his new script, 365, is still taking shape