"scarcely" is very formal and you shouldn't use it when talking to a friend. Other than that, it would probably be understood correctly in this context.Just for comparison, can we use scarcely instead of barely with the same meaning?
I can scarcely do that. It's illegal.
Isit right that scarcely is merely more formal than hardly?
The inversion in your sentence sounds very unnatural.And another point. I used inversion initially, but you have avoided this. Doesn't the inverted sentence sound naturally?
Hardly can I do that. It's illegal.
Am I right about the emphasis?I can hardly agree to do that for you.
Putting hardly first does not make the sentence wrong (it makes grammatical sense), but the emphasis is wrong for this context.