This custom slice function returns a substring from a given word, starting at beginIndex (inclusive) and ending at endIndex (exclusive), similar to the behavior of JavaScript’s String.prototype.slice(). It also includes an optional reverse flag — if set to 1, the result will be returned in reverse order.
Inspired by: JavaScript's slice(begin, end) Extended Feature: Optional reverse functionality for flipped output. All logic implemented using basic Scratch blocks — fully Scratch-compatible!