Anything can be done to the rigging. That does noto mean you should do it... Or it means that you will change the design and engineering that went into your boat. If you choose that path assure that you will not be creating problems that do not exist presently.
The change to from the cockpit to the cabin top means you will be changing the forces on the boom. You likely have a single point of attachment at the boom end. This location means more control with less force on the boom.
When you move the attachment point to the middle of the boom it takes more effort (force) to adjust the boom (mainsail). The solution is to spread the force over several points on the boom. You will need to get a traveler that is smooth to run and fits the space you have on the deck. You will need to secure the traveler carefully on the cabin. This will mean taking down the head liner to through bolt the traveler. Use properly sized backing plates on the bolts. The traveler will carry the full force of the mainsail during a blow.
Here is a picture of a 1995 Hunter 336.
The rigging shows 3 blocks attached to the boom, with the mainsheet running down to the deck and back to the cockpit. Control for the mainsail in this image would be the traveler. You will find the adjustment is different than the way you have sailed your rig. If you have a dodger then you have some more modifications to make.
Think the project out carefully and see if having the traveler on the cabin top will be better for movement around the cockpit, but less convenient or easy to manage the mainsheet when sailing the boat.
Good luck. Let us know what you decide.