Does the dishwasher still work ok other then that?
Does it get hot?
Are the spary arms spinning round ok?
Ok so the top spray arm is spinning during the wash?
Do you have any air freshner or anything like that hanging on the top basket on the same side as the dispenser unit.
Ok if its not actually opening some times then its possibley the dispenser itself thats the problem here. As theres a coil in there which moves a bar inside there. The coil will be fine otherwise the dispenser will never open. So its possible the bars in there are jamming not relising the door for it.
As if its getting hot and the spray arms are spinning then thats all it can be. Other then the control unit but its quite rare a control unit will cause this fault.