The Script Editor can't add tags but you can look at adding Line Item Properties using the change_properties method.
The order data itself will show if a discount was applied. If there was not discount code used you'll know that it was something applied with a script.