When I am marathon training I like to really "race" a race about 4 weeks prior to my target marathon. Ideally, I try to race a half-marathon, although last spring I targeted a 10k because it was the only race I could find that was 4 weeks out. I then do my last long run of 20+ three weeks out from the marathon. So in my opinion, to really race a half-marathon three weeks out might be a bit close. However, if you want to do it as a "tune-up" to test hydration, gels and to get the feel of a long race, then I would say it could be beneficial. Question, when would your last long run (18 or 20+) be if you ran the half three weeks out?