You should give it a try, IMO the hardest part would be to find a team.
I think that if you are doing so well at 3.5 you probably only need to get use to a few things to do a decent job at 4.0:
1. The ball will come back more often. be ready
2. People hit better shots more times - they consistently hit good shots. Be ready.
3. Faster pace, for this you just have to play more to get used to it.
4. Get in better shape, it is amazing how that change in pace and type of ball can affect your physical condition, you will find that having to get ready faster and to hit back some balls takes a lot of energy, even if they are directed at you.
5. Be faster, IMO this is at least 60% a mental thing, remember yourself to be ready faster, to recover from your serve faster, to start running faster, you will be really tired the first times but you will get there.
6. Be smart, people dont just hit the ball back, they place it in the right spot most of the time.
Another thing, 40 is not old! you have plenty of time to get better, it will take time and you will lose some matches (a lot actually!) but you will get there. Personally I am a very competitive player, I play to win and while tennis is about having fun I certainly have a lot of more fun wining than losing, however, there is a point when winning 60 60 is not fun anymore and losing in 3 sets to really good players becomes a heck of an accomplishment and you end up with a smile in your face eventhough you lost, now imagine when you start winning!