I agree with the prior comments. I do have an example of a time when I have wanted to define event handlers in functions, and in fact, in loops. The code sample below creates 20 buttons that scroll. Only 11 are visible at any time. I’ve used a similar approach to making a spreadsheet like display in appLab. This is clearly beyond the minimum scope of CSP, but I have students who ask, so it is nice to be able to show them how it can be done.
https://studio.code.org/projects/applab/WVw_r8mdpwB2dRK6hEs9Ng
// make a bunch of buttons that do similar things