"It is not working"
In other ( more ) words ?
BTW: Else If [ ] must be replaced by a simple Else.
Revert Record/Request [No dialog]
Warning, your script trips it's own script trigger as the Commit Records step will trip the OnRecordCommit script trigger--calling itself in an endless loop of script calls.
Remove the commit Records step and use Revert Record after the Else step that raybaudi has told you to use.
Using Record Level Access control is a much better option. For one thing, it can keep a user from even attempting to change the data where your method catches the issue after the fact and tries to restore things if it is not permitted.