How to cook chicken legs more evenly?
I think opening the oven door every 15-20 minutes is causing the oven to loose a lot of heat very frequently, therefore the process becomes even more prolonged. Try these steps:

1) Make minimum of 3 slits diagonally. 

2) Cover the chickens with foil in the first 15-20 minutes of its cooking time to creat and retain steam inside the meat and then uncover and continue with your process.

3) Baste less frequently to maintain the oven heat.