That's fine to do. The 24-hour recovery rule more or less only applies to when you've worked out the muscles to a very large extent. Crunches before going to sleep likely aren't putting very much strain or damage to the muscles, so there won't be any problems with recovery.
That being said, I honestly can't see crunches as a very effective means of getting to sleep. Sure, you can try to fatigue your muscles, but working them out is going to increase your blood flow and essentially wake you up even more.