it really depends on the framing, some work, especially fun work that develops skills is more valuable than people realize.
From an org perspective the goal is to create the highest curve of performance over the lifetime engagement of the employee or from the employee perspective their career.
And a lot of that depends on teh relationship of the people involved. From my perspective its a net negative when if my movers worked out the day before, their muscles will be sore and they'll do a worse or slower job. From the moving companies perspective its good, they'll be stronger for more jobs. Unless they quit or are fired that day, in which case we're back to bad.
The real evaluation isn't the macro vs the sublime edit. its does the thought process of making them macro improve them in other things, and what were they doing before that. In my experience no one is going use the time they spent writing a macro or a learning vim to do real meaningful work, they're doing that because they're bored or burned out and want to think about something else they find fun at the time.
your problem isn't your employees choose to write random scripts, its that they dont have a sense of urgency or care about their current task.