When the LSO script is executed it will configure my resources. One of the resources is linked to a license server and will look if there is a license available. How can I send back the result to my LSO script so that it can continue (license available) or stop (no more licenses available)?
The above answers are correct for a normal scripts, though it's not the case for an LSO > Profile Load Script situation.
With the current SRM solution you cannot do that, it's not possible to return a value, though if you want to cancel the resource configuration you should just thrown an exception on your Profile Load Script and then handle it correctly in your LSO script.