Is there a more formal option for 'just in case'?
Rare is the time when a ‘general’ answer can be given to a question like this. A more formal version of something else will always depend on the context.
In your specific context, I would agree with Andrew that simply getting rid of ‘just’ would make the most neutral and mellifluous phrasing. A few other alternatives could be:
I have also attached the original document, should you need it/should it be required.
I have also attached the original document in the event that you need it/it is required.
Of course, these rephrasings will not work in certain other contexts; for example, “I have attached the original document just in case” cannot be rephrased to any of the above. You would have to infer from the context whether that should be rephrased to something like, “For the sake of completeness, I have attached the original document” or perhaps even, “Erring on the side of caution, I have attached the original document”.
Only context can tell.
You can make it more formal immediately by simply omitting just:
I have also attached the original in case you need it.
You can make it more formal than that by not referring to you. Using the passive voice is less conversational and therefore more formal. It also means you are not implicitly accusing the person of losing the original. There are a number of other ways of doing that too.
I have also attached the original in case it's needed.
For your convenience, I have also attached the original.
Generally, although it would probably not be useful here, you might also consider words based on contingency.
If formality is the only consideration, then another way of phrasing it could be:
I have also attached the original document should it be required.
Seriously you don't need to add 'just in case' or anything else. You have attached files that aren't asked for so the assumption will be that they are 'just in case'.
You could state at the beginning of your sentence the purpose of sending the original document. Note I chose to omit "also" as it is already implied in the statements. The degree of formality you feel comfortable with is a personal choice; you can adjust the tone accordingly to your needs.
Should you need further data, I have attached the original document.
For the sake of clarity, I have attached the original document.
In order to be thorough, I have attached the original document
and as suggested by @Andrew Leach
For your convenience, I have attached the original document.