In Arkham Horror, can you pay sanity costs to go insane on purpose?
Yes. Just as there's nothing stopping you from not using your weapons to purposefully fail a combat check against a Nightgaunt to go through a gate, or purposefully failing a sneak check to take combat damage and get sent to the hospital, there's nothing stopping you from casting a spell when there's no chance of you succeeding. The closest thing I can come up with for a reference to your suggested scenario is a question from the Kevin Wilson Answers thread on the Fantasy Flight Games forum:

If one goes insane or unconscious or is devoured as a result of casting a spell or using an item, is it generally the case that the
effect of the spell or item still occurs (in the same way an Elder
Sign's effect takes place even if one of the above happens as a result
of using it)?
Yes. It will often not matter, however, as in the case where you're
getting a combat bonus or something.

So it's definitely allowed that you could cast a spell that drives you insane in the process. So a useful last-sanity draining spell use could be Healing another investigator, or casting Bind Monster, or Greater Banishment, etc. Anything with an immediate effect after making the Casting Check. The only limitation on the spell casting I'd say is that you can't try to cast a spell outside of a situation it would be useful in. i.e. I wouldn't allow casting Shriveling outside of combat just so the Investigator could go insane.