What is the delay and what you scan time? If the delay divided by the scan is not a very large number, you can create an array of size N = delay/scan, that will work as a queue, i.e. every scan you will push a new value into the array and shift all values by one position, so the oldest value will be the delayed value.
Hi , Also you could use move function from system then check enable , and in this pin you can connect specific logic condition , when the enable pin is false the value result is frozen and when enable pin is true the value change . it is easier than create an user defined function block