In my Wrap Around Demo project, I included three versions of the "stamp" custom block. This project compares the performance of the three methods.
Method 1 checks if the sprite is near the edge, and if it is, it checks which edge(s) it is near, and then stamp duplicates at the relevant positions. Method 2 checks if the sprite is near the edge, but not which edge - it simply stamps duplicates in all directions. Method 3 doesn't even check if it is near the edge - it continuously stamps duplicates in all directions. In this performance test, each method is run 10,000 times, and the time is measured in seconds. - - - Results - - - Method 1 is the fastest, but method 2 is only marginally slower. Method 3 is about 4 times slower than the others. If we look at the code, method 1 uses 37 blocks, method 2 is a bit simpler with 26 blocks, and method 3 is very lightweight with only 10 blocks. To sum it up, it is a tradeoff between performance and code simplicity. If you have a need for speed, use method 1. If simple code is what you are aiming for, use method 3. If neither is crucial, method 2 might be a good choice.