In the aforesaid delta hedging of stock position, how was the delta of long stock computed by author?
An option pricing formula yields the delta of an option. There are lots of web sites that provide this.
In my opinion, total long position of 500 shares divided by the market lot of one put option which is of 100 shares. Is that correct?
It's not clear what you're asking. Nor is the explanation in your link.
If you own 500 shares, you are long 500 delta. A put controls 100 shares so if its delta is -.50 then one put has a delta of -50. Buying 10 of them gives you the -500 delta that you need to offset the +500 delta of your long shares.
You need to understand that being long or short the option determines whether you are long or short delta. With a put delta of -.50 then as stated above, buying ten of them means that you own -500 put delta. However, if you shorted 10 of these puts, you'd be long 500 delta.
Delta hedge requires continuous management. In the continuous management of delta hedging, how to determine whether the stock position is overhedged or underhedged?
Calculate your total delta. If positive, you're net long. If negative, you're net short.
I'd suggest that you google for additional information. There are plenty of web sites that explain this in greater depth and provide examples.