'Gotham' star Ben McKenzie branches out, pens episode