It’s not that subtle. The latter means that she was happy to grin, the former that she was grinning in a happy way. The line is only really blurred between these in poetic registers.
Moving "only" to any other spot in this sentence is grammatically correct and changes the meaning.
As for "rules", well, welcome to English: the rules are made up and the points don't matter.