Another possibility is that Draco Malfoy himself gives the manor to Hermione. After seeing the error of his ways and realizing Hermione's great character, he decides to make amends in a grand way. He might feel that Hermione could put the manor to better use, perhaps for the benefit of the wizarding community at large, like turning it into a school for underprivileged young wizards.
It could also be a result of a magical bargain or curse gone wrong for the Malfoys. Suppose there was a powerful dark magic object in the manor that got out of control. Hermione, with her vast knowledge of magic, manages to contain it. In the process, she ends up being the rightful owner according to some ancient magic laws. This would make for an interesting plot twist in the fanfiction.
Perhaps they are there to rescue someone. Hermione might come up with a clever plan involving potions and charms to get past the manor's defenses. Ron, with his loyalty and determination, would be right by her side, ready to take on any danger that comes their way.
In some fanfictions, Ron and Hermione could be at Malfoy Manor for a diplomatic mission of sorts. The wizarding world is in chaos, and they are sent to try and convince the Malfoys to switch sides. This would be a very difficult task as the Malfoys have long been associated with the dark side. But Ron's loyalty and Hermione's persuasion skills could potentially make a difference.
Another way could be through a potion gone wrong. In the wizarding world, potions can have all sorts of strange effects. If Draco was trying to brew a potion for some other purpose, like trying to gain an advantage in a competition or something, and made a mistake in the ingredients or the brewing process, it could result in him being transformed into Hermione. This would force him to experience life from her perspective, which could be a huge character - development opportunity for him.
In some fanfictions, Hermione might find out she is a Malfoy due to a spell gone wrong. For example, a spell that was meant to reveal family lineages got mixed up and suddenly she has a connection to the Malfoy family in the magical world created by the fanfiction writer. It could also be a result of a hidden prophecy that links her to the Malfoys in an unexpected way.
In fanfiction, Harry staying at Malfoy Manor could lead to some unexpected alliances. He could end up befriending a house - elf there who helps him in his stay. This house - elf might know secret passages in the manor that Harry can use to his advantage. Or, Harry could even find a way to turn Draco Malfoy to his side during his stay, which would be a huge shift in the power dynamics considering Draco's family's loyalty to Voldemort.
Well, one scenario could be that they are attending a peace - making event. Hermione, being the diplomat, tries to make amends between the Weasleys and the Malfoys, and Ron is there just to support her and make sure she doesn't get into any trouble. But things quickly go awry as old rivalries resurface.
It could be that in the manor, they discover they have more in common than they thought. Both are under a great deal of pressure - Draco to please his family and uphold the Malfoy name, and Hermione to fight against the Dark forces. As they interact more, they begin to understand each other's struggles, and this understanding leads to a deeper connection. Maybe they start to communicate without words, just by looks, as they plan their next move to survive or escape the manor.
Well, at the school reunion, Hermione and Malfoy might have an awkward encounter. Maybe they would finally bury the hatchet and start a friendly conversation about their past rivalries at school. They could even share a laugh about some of the silly things they did back then.
After Malfoy Manor, their relationship could also become more public within the wizarding community in fanfiction. They may face different reactions from friends and family. Some might be overjoyed seeing them finally together, while others might be a bit skeptical. But through all this, Ron and Hermione would grow closer, learning to deal with external pressures as a couple, and also finding new ways to support each other in the fight against the Dark Arts.
One storyline could be Hermione using the manor as a place to gather and protect magical creatures. Since she is known for her love of all living things in the wizarding world, she could transform the manor's grounds into a sanctuary. The Malfoy family's old dungeons could be converted into a healing area for injured creatures. This would bring a new sense of purpose to the once - dark and foreboding manor.