I am not sure that there exists something in SAP HR in pure form which supports your use case. But you can handle the scenario as mentioned by you by making some changes here and there.
There exists an infotype ‘Contracts’ with SAP HR which stores the type of employment of the employee like permanent or contract. You can take care of this type by flipping the status of the employee type by some third party service. Once the employee resigns then rehire him as a contractor but create a dummy pay roll so that it does not gets picked up in payroll.