Set-state-node how can it be used for leverage of sms otp messages

Hey forgerockers …looking for a solution how set-state-node could provide instead of scripts pls convey. I had a common requirement to usng same node on sms otp msg. Any help will be appriciated!!