tag @s add KyuTagged

#take UUID part 1, divide by 361 and take the remainder to get a random number between 0 and 360. Subtract 180 to shift the number range from -180 to +180. Then, apply that random number to the Y rotation.
execute at @s run execute store result score @s KyuDummy run data get entity @s UUID[0] .1
execute at @s[tag=RunningFunct2] run execute store result score @s KyuDummy run data get entity @s UUID[1] .1
scoreboard players set @s KyuDummy2 361
scoreboard players operation @s KyuDummy %= @s KyuDummy2
scoreboard players remove @s KyuDummy 180
execute as @s run execute store result entity @s Rotation[0] float 1 run scoreboard players get @s KyuDummy

#same thing as above, but with a range of -90 to 90 for the X rotation
execute at @s run execute store result score @s KyuDummy run data get entity @s UUID[2] .1
execute at @s[tag=RunningFunct2] run execute store result score @s KyuDummy run data get entity @s UUID[3] .1
scoreboard players set @s KyuDummy2 181
scoreboard players operation @s KyuDummy %= @s KyuDummy2
scoreboard players remove @s KyuDummy 90
execute as @s run execute store result entity @s Rotation[1] float 1 run scoreboard players get @s KyuDummy

#if the marker is running this function for the first time, set its KyuDummy3(counter scoreboard for next function) to a random number between 0 and 15.
execute as @s[tag=!RunningFunct2] run execute at @s run execute store result score @s KyuDummy3 run data get entity @e[limit=1,sort=random] UUID[0] .1
execute as @s[tag=!RunningFunct2] run scoreboard players set @s KyuDummy2 15
execute as @s[tag=!RunningFunct2] run scoreboard players operation @s KyuDummy3 %= @s KyuDummy2


#now that the marker is facing a random direction, run the nex function - unless it is running this current function a 2nd+ time to reset its rotation
execute as @s[tag=!RunningFunct2] run execute at @s run function zzzzdonotuse:biomecorruption/colorfulcorruption/treebranch2