I used to have a friend, whom I will call "A" (she was a philosophy major). At some point, she feel in love with a friend of hers, whom I will call "B", who had been pursuing her romantically. They became a happy couple.
I learned at some point from her that there was a young man who went to the same church as her and B, whom I will name "X". X was not a good person according to A. I don't remember all the details, but he could well have been immature, or had a bad personality, or was in some deep sense ill-intentioned, or something else. In any case, A did not trust him. And it became apparent that he had a crush on her.
At some point, X said that God had told him that he was going to marry A. (A and B eventually got married -- I don't remember if they would have been engaged at this point or not.) The pastor of A, B, and X heard about this and had a talk with them. He told X that God does not tell people that they are going to marry people if the person being sought or desired is in a relationship already (boyfriend and girlfriend? engaged? I can't remember / would depend on whether A and B were engaged at that point or not).
This story has stuck with me for years -- it came from a past era of my life, and it's been quite a while since I was friends with A, as well -- and I still think about what might have been going on.
Did X hear a voice from God? Or from some other spiritual source? Was the pastor's judgment Biblically-based? Or was he saying something pragmatic? Or was he led by the Spirit to say what he said? Or by a spiritual force of pragmatism?
I don't know, and I suspect that the people in the situation also didn't really know.
So what should X have done? Let's assume that he was sincere and wanted to please God. If God tells you you're going to marry someone who is in a relationship, but it could be Satan telling you that, you could say "I just shouldn't listen to that voice, try to forget I heard it". But what if God is trying to tell you something important? It's risky to not listen to God when he's trying to get you to do something, as much as it is to listen to Satan when he's trying to get you do something. So X might not ought to have just forgotten he heard the voice.
So now what? As a sincere, theistic young man, X might say "well, how can I be most pleasing to God in pursuing this message that I think might be from him, given the possibility that it is from Satan?" He might think of all the ways that Satan could use this message. Perhaps Satan would want X to harrass A and discourage her. Maybe Satan would be setting up a two-step scam, where because of him harrassing her, she had to (or would be tempted to) put up defenses, act out of fear, judge X, etc. Or maybe if he looked further ahead he could see the potential of Satan using his action to affect other people in the church community or the community as a whole. A two-step scam could be meant to get the pastor to form pragmatic judgments ("let's just not have creeps hitting on young women in my congregation") rather than really being open to the range of things God could be asking, weird though they may be -- to put practicality before obedience to God. And this emphasis on the pastor being the "professional manager of human situations" could affect his overall approach to leadership, making him less deeply theistic and thus less able to anti-tempt.
A smart, safe thing X could have done would have been to not mention that he expected to marry A, to stop showing outward romantic interest in her, and simply try to love her and love God, not with any sense of grasping but with the hope that is a "non-technique" (as Godfrey puts it in A Philosophy of Human Hope), hoping that someday she would understand that B wasn't the one for her after all, if that was in fact the case. Or even to persevere in loving her without grasping onto that potential outcome (of her realizing that he was more suitable for her). He could try to change to become more suitable for her.
If X learned the ever-educational way of the desert, and perseverance, hope, and trust in God, and sought to become a generally trustworthy person (and thus more trustworthy to God), through the message of "you will marry A", and didn't harrass or otherwise bother A, then no matter where the message came from, the outcome would be fairly unambiguously good from God's perspective (assuming that there are no other significant factors than the ones listed). It might not have been the best possible outcome (maybe X could, or couldn't, have known that God didn't really give that message, and either way it would have been better for him to not listen to it), but unless deciding to forget the message would have furthered some bigger plan of God's (that is, if we just evaluate this situation in itself), it would no longer be a win for Satan, but rather more so a win for God.
So, if that message came from Satan masquerading as God, if X had been serious about pursuing God, and had known how, he would have actually turned Satan's weird advice into something good.