Hi Nhtbao101,
Just to understand your use-case fully - do you want to update the customer metafield during the checkout process, or after - ie: once the order is processed? When do you want the discount to be applied?
Once I have a little bit more info I can recommend the best approach!