So pleased for you that you're moving forward now as opposed to later. Interest rates are inching their way up and very soon, buyers will have less buying power than they do today or have had for the last few years.
In any event, you should be fine with this. As all of my colleagues have said here, it's a matter of just disclosing where this came from. I mean, it's not like the underwriter is ONLY looking at this money to approve your loan. They will "get it" when they see the paper trail. You sound like you're doing everything right, you didn't go out and incur new long term debt!!!
May I ask, why haven't you posed this question to your lender?? They would be the best person to counsel you on this matter. Next would be your own agent. Even as a 2nd time buyer, it's important to have your own agent.
PS Enjoy your new home...you will save in the long run, and when you get ready to begin repaying the student loan, you will have more economic stability because you are in your own home.
This one is easy. It's all about paper trailing and documentation. If I am reading this correctly, you are concerned about the student loan refund deposit, correct? Just provide documentation showing what that deposit was. In other words, you will need to source that deposit.
Voila! You are done.
Best wishes to you,
The MN Mortgage Mom