Pay off or Invest

I am so confused! I know I should know this since I have worked in a bank for 10 years. But after talking to a few people, I am more confused than ever.

Here's my question to you: Which would you do first? Pay off loan or invest? If you have an extra $$$, would you pay off your mortgage with that money? Or would you invest it in an educational plan for your kids?

Investing in an educational plan (RESP) would automatically allow my money to earn at least 20% because of the government grant. I wouldn't get this if my kids decided not to pursue college/university degree. Which means my earnings would only be about 3% as guaranteed by the company.

On the other hand, my mortgage interest rate is 3.97%. Paying off additional $$$ to my loan would mean paying off my loan a little faster, hence lesser interest.

Your inputs would be greatly appreciated. Please help!