Firstly, Dialog is spelled as 'Dialogue.' English is probably the worst language for silent letters haha!
1a) 'No, I haven't played tennis for years.'
When we are talking about something we haven't done for a long time, the verb describes the past tense. Here are some examples:
I haven't seen him for weeks.
I haven't played that game in years.
She hasn't danced since she was young.
2b) 'How long have you been having guitar lessons?'
'How long have you had guitar lessons,' doesn't quite make sense, because 'had' is past tense.
Because the guitar lessons are still ongoing (I'm assuming), it would be 'been having.'
For example, if you were to see someone playing guitar, you would ask "How long have you been playing guitar?" It is something someone has done in the past, and they are still doing it now.
...been having
...been playing
...been writing
...been running
I hope this clarifies things for you a little! If you have any questions, please shoot me a message!