Hermione have done to her had they discovered her? If she knew herself, she would have waited for Polyjuice to wear off while casting spells on her doppelganger to see if the effect was achieved through magic. Then she would have reported the captive, the imposter, to Dumbledore or Professor McGonagall.