My notes on these lectures. Feel free to share them. If you find any mistakes, please let me know
........

وَلَـقَدۡ هَمَّتۡ بِهٖ‌ۚ وَهَمَّ بِهَا‌ لَوۡلَاۤ اَنۡ رَّاٰ بُرۡهَانَ رَبِّهٖ‌ؕ كَذٰلِكَ لِنَصۡرِفَ عَنۡهُ السُّۤوۡءَ وَالۡـفَحۡشَآءَ‌ؕ اِنَّهٗ مِنۡ عِبَادِنَا الۡمُخۡلَصِيۡنَ‏ ۞

When Allah captures history, He tells us not just the actions and words of the people involved, but also what was going on in their hearts, what were they thinking, what were they planning etc.. This in itself is miraculous as it can be done only by someone who knows what the hearts reveal and even what they conceal...
انہ بعادہ خبیرا بصیرا
انہ علیم بذات الصدور
 Subhan Allah

Here Allah is watching and recording what is going on in a closed room and within that closed room, in closed hearts...

وَلَـقَدۡ هَمَّتۡ بِهٖ‌ۚ
And for sure it is a fact that she absolutely had extreme desire for him. 

ھمّ
Means hell bent on getting something one desires. cf اھتمام and مھم

وَهَمَّ بِهَا‌

Using the same verb twice is a device in Arabic which tells us that there is a difference between the desires of the two. If it were the same it would have been said, "they desired each other"... 
2ndly لقد is not used here indicating difference in severity. 

In some translations it is like, "and he desired her". In others it is, "and he would have desired her too" ... 

According to Razi:
A Muslim is not held sinful for his desire for water while fasting. 
Hence "feeling" of physiological, biological attraction by a young, unmarried man for a woman is not a sin. 
Now the difference between their desires is that she had been nurturing it and culminating it into a sinful act. 
On the other hand Yusuf AS has been guarding his gaze and avoiding her for ever, and especially now that he has the opportunity to feed his desire from nafs and satan, he seeks refuge of Allah to protect him from falling into this trap. 
So even if a prophet has to be on his guard continuously to save himself, who are you and me. We can't say, "she's just a sister in Islam" and "don't question my intentions, bro." 

The 2nd meaning that he did not even have the desire for her is equally applicable as we know that he had been guarding himself so meticulously that he doesn't even address her directly, doesn't give her even the least bit of attention that she sought... 
لَوۡلَاۤ اَنۡ رَّاٰ بُرۡهَانَ رَبِّهٖ‌ؕ
Had he not seen a glaring evidence from his Rab

Suggests that he could have had a desire for her had he not had a proper shield. The shield is برھان. In Arabic, برھنہ is something that is clear and beautiful and attractive.
So برھان is something clear and self evident.
Yusuf AS is in a situation where feelings can become confusing but he had such a clear guidance from his Master that he absolutely clearly knew what is wrong.

Knowledge is something in some shelf in our brain. But sometimes we don't necessarily "see" things in light of that knowledge as it is not evident to us in that moment. Hence Allah did not say that he avoided it because of something he knew, some knowledge he had...
But actually physically seeing something makes our brain recall the knowledge related to it. So Yusuf AS "saw" (رَّاٰ) the evidence from Allah... It implies that Allah brought up that knowledge that made him "see" that attraction is not in that woman, but rather in running away from her. And this "choice" he made was due to the wisdom (حکما) from Allah, mentioned previously and that is the "clear evidence"(برھان) meant here. It also implies that this knowledge and wisdom sometimes makes us "see" things in an opposite perspective than others.
Eg, in surah aal e Imran during battle of uhd, when Muslims were in a very difficult situation and outnumbered, Allah tells them to run towards His maghfirah and jannah.... Where everyone sees certain death, a believer sees eternal life of bliss... Subhan Allah... We as believers "see" things in the light of the burhan from our Rabb...

While prohibiting marriage with mushrikeen, Allah says that even if you like them very much, even if you are in love with them, remember that they are inviting you towards hell fire, so avoid them...

That is meant when Allah says
لھم اعین، لا یبصرون بھا
That they (disbelievers) see only the obvious and superficially.. 
In surah Rum, ayah 30, Allah says
یَعْلَمُوْنَ ظَاہِرًا مِّنَ الْحَیٰوۃِ الدُّنْیَا
In surah an najm, ayah 30:
ذَٰلِكَ مَبْلَغُهُمْ مِنَ الْعِلْمِ
"That's as far as their knowledge goes"

Like in Ramadan, the برھان of our Rabb makes us "see" halal food as haram during the fast... 

So it all boils down to whether we "see" our knowledge of right and wrong, in action, when we are tested, or not... Like, right now I know about the burhan, but when I go to work and see her, and she asks me out for coffee, do I actually see that burhan at that moment or not and do I act accordingly or not? 

In our consumer society, we have become "consumers" of religion.. We adopt it when it makes us feel better... Like praying salah and we shut off the burhan of Allah at other times when it doesn't make us "feel" good... Like hanging out and inter mixing and partying and music etc... 

And it is remarkable that Allah has attributed the act of seeing the burhan to Yusuf AS... He does not say that We showed him the burhan... Indicating that Allah comes to help when we take the first step ourselves... Refer back to:
کذالک نجزی المحسنین... 
So Yusuf AS knew and kind of "saw" that he is not alone with that woman in that locked room, as that is what ihsaan is.. Worshipping Allah as if you are seeing him. 
And as Allah says in surah Mujadilah, ayah 7:

مَا يَكُونُ مِن نَّجْوَىٰ ثَلَاثَةٍ إِلَّا هُوَ رَابِعُهُمْ وَلَا خَمْسَةٍ إِلَّا هُوَ سَادِسُهُمْ وَلَا أَدْنَىٰ مِن ذَٰلِكَ وَلَا أَكْثَرَ إِلَّا هُوَ مَعَهُمْ أَيْنَ مَا كَانُوا. ثُمَّ يُنَبِّئُهُم بِمَا عَمِلُوا يَوْمَ الْقِيَامَةِ ۚ إِنَّ اللَّهَ بِكُلِّ شَيْءٍ عَلِيمٌ
Allah is present, and recording, in every secret meeting, whether actual or virtual, and will tell us what we did or said even if we "delete" the evidence... Allah always has our "backup files"...!!!

كَذٰلِكَ لِنَصۡرِفَ عَنۡهُ السُّۤوۡءَ وَالۡـفَحۡشَآءَ‌ؕ
Now Allah describes what He did for Yusuf AS, after he had taken the first step... 

"That is how we turned evil and shamelessness away from him" 

He is not saying that we took the desire away from him... He actually means that desire in itself is not evil, its how we act upon it, is good or evil... 

Here السوء is evil and الفحشاء is one kind of evil.. So evil includes shamelessness... But Allah mentioned shamelessness separately to underscore its importance in this scenario... Allah knows that a natural desire csn can easily turn towards الفحشاء... 

This here is the 2nd time Allah is mentioning His intervention when a believer takes a step in the right direction... 
Reconsider the scene... 
One's nafs, ie he himself is pulling him towards evil, the other person is exerting some kind of emotional pressure to pull him towards evil. Both are aided by Satan on top of all this... Still the person sees the burhan, feels the presence of Allah and decides not to give in to his desires and temptations... Then Allah intervenes and steers evil and shamelessness away from him... Meaning preventing his heart to get inclined in that direction... 
Another benefit of mentioning evil and shamelessness together is that zina is not just someone's personal problem. It is a crime against Allah and the result is that the resulting shamelessness will corrupt your moral compass regarding all other sins and it would be easier for you to fall into them. 

اِنَّهٗ مِنۡ عِبَادِنَا الۡمُخۡلَصِيۡنَ‏
Here الۡمُخۡلَصِيۡنَ‏ can be read both with زبر or زیر on ل..
With زیر it means "no doubt, he was among our sincere slaves"
Sincerity means that good deeds done only for the sake of Allah...
In this context, it is possible that a person slips and messes up, and later repents sincerely but Yusuf AS was so sincere that he wanted to avoid the act at all costs even if he had to go to jail for that (As comes later)..

When read with زبر it means, "those given sincerity" or "those made pure"...
Meaning when Allah's slaves demonstrate that they would do whatever is possible in their power, then Allah will grant them the purity needed to continue the acts of piety... Allah removes evils from their hearts... Make them purer than they themselves possibly could...
Remember that satan promised to mislead all humans except the الۡمُخۡلَصِيۡنَ‏... So we should strive to become that... 

Today those who guard themselves are ridiculed that there is something wrong with you that you need to guard yourself... The natural state of affairs is flipped and corrupted by our modern society..

And the message here is that don't become lax when it comes to guarding yourself.