Hi Arlene,
If I recall correctly, I got the 7:00h train from Atocha and got into Pamplona around 11:00h. So if you leave Madrid at 14:10h , you definitely won't make the 18h bus. I would strongly suggest staying overnight in Pamplona. If you have your credencial, you may even be able to stay in the albergue overnight and you will have the entire next day to explore Pamplona - cathedral, encierro,its many churches, interesting buildings, restaurants and on and on. You can catch the bus in the evening and still arrive in Roncesvalles in plenty of time for the 20h Pilgrim Mass (Not to be missed!) Then, when you are walking back, you have already seen Pamplona and you do not need to stop there but can go on to Cizur Menor which has two lovely albergues. I chose the Knights of Malta (the first one on the left) but I believe Vinotinto has great things to say about the other, private albergue in the charming small village.
From your post I have the impression that you are planning your Camino for early in the year - do not attempt to stay in (or anywhere around) Pamplona in mid July ... there are NO places available during the Fiesta de San Fermín commonly known as the Running of the Bulls!
Buen Camino,