Hello,
There is no need to use scripts to achieve the desired behavior. It can be done using the Update the user action in your deprovisioning workflow. For example, if you use a custom command to deprovision users, it will look like the following:
For your information, the clear action is not required if you need to only set Extension Attribute 5 to NoLicenseNeeded.