execute if block ~ ~ ~ minecraft:repeater[facing=north] run scoreboard players set @s vb.dummy1 1
execute if block ~ ~ ~ minecraft:repeater[facing=east] run scoreboard players set @s vb.dummy1 2
execute if block ~ ~ ~ minecraft:repeater[facing=south] run scoreboard players set @s vb.dummy1 3
execute if block ~ ~ ~ minecraft:repeater[facing=west] run scoreboard players set @s vb.dummy1 4

execute if score @s vb.dummy1 matches 1 run setblock ~ ~ ~ minecraft:repeater[facing=east]
execute if score @s vb.dummy1 matches 2 run setblock ~ ~ ~ minecraft:repeater[facing=south]
execute if score @s vb.dummy1 matches 3 run setblock ~ ~ ~ minecraft:repeater[facing=west]
execute if score @s vb.dummy1 matches 4 run setblock ~ ~ ~ minecraft:repeater[facing=north]