This seems like some low-risk ‼Science‼ -- keep an engraved (but unbuilt) memorial slab and you can kill the experiment the instant the restless dead get too Fun. Easy to restart it too!
To get a steady supply of angry ghosts, you need a steady supply of unhappy dwarves, ideally without your entire fortress entering a tantrum spiral. You also need to ensure their bodies remain unburied, while not stopping your other dwarves from being buried -- we want to observe specific ghost behavior, not a large stream of ghosts.
Our test dwarves need to have no non-test friends, and be easy to drive berserk controllable fashion. We could achieve this by turning off stone detailing in all dwarves except test dwarves, training them up on smoothing, and then sending them to a remote part of the fortress with a LOT of engraving to do. By the time they do their engravings, each one should have enough skill to engrave masterpieces with decent frequency.
Once the engraving is done, burrow the test dwarves to test chambers. the test burrow can have a communal food stockpile and dining room (NOT designated as a meeting area), but to prevent uncontrolled mass berserk spirals, each dwarf should have a private room (just a bed and a door) to stop friendships/marriages/children from interfering with results. The best candidates are a) useless and b) angry types, rather than depressive ones.
With bare minimum amenities (only one type of booze, only one type of food with no quality, all furniture of the lowest quality, no value enhancers like smoothed stone, no friends to talk with, ideally no access to cats), the dwarf's nerves should already be frayed. putting these dwarves in squads to get them "enraged by long patrol duty" could also help have them unhappy to very unhappy, but stable at that level and not tantruming. If the dwarves are too happy, additional steps involving well-placed refuse stockpiles for miasma generation can be included. To drive the dwarf insane and kill them, the following procedure seems appropriate.
Reassign the target dwarf to a "death chamber" burrow, consisting of a room with a raised drawbridge, separated by a door from the rest of the fortress, ESPECIALLY the test group. once the dwarf is in the death chamber, seal the door and designate one of their masterpieces for mining/channeling/floor construction, whatever it takes. They will "suffer the travesty of art defacement", which is a massive bad thought. The dwarf will be miserable and get worse as they begin to starve/dehydrate in the death chamber. If they berserk, you can atom-smash them both removing the body (denying any chance of accidental burial) and speeding up the ghost-creation process. Otherwise, probably best to let them starve as the bad thoughts accumulate, making them more likely to come back as a nastier ghost.
Once the ghosts start rising, they tend to linger where they died, turning your death chamber into a ghost hotspot. The dead won't be confined to it, but they should congregate there, hopefully creating the danger room of the damned in the process. This should also help give future dwarves sent to it even more bad thoughts as they are assaulted by the dead.