I had/have the same problem with my 98 XJ, or at least it sounds like the same problem.
The keyless entry would lock, but not unlock, sometimes. If I pressed it enough times, lock/unlock, it would unlock.
When it wouldn't I would use the key to let myself in and then toggle the lock/unlock on the door multiple times until it started working.
It seems to happen more during warmer weather.
Recently I replaced the front speakers, and I stopped having this problem.
Part of replacing the speaker was to remove the the panel from the driver's side door. I had to disconnect the driver's control module (windows, door locks).
I think this is what fixed it.
Pop the door panel off. Try a contact cleaner where it attaches to the power lock/power window control module.
Failing that you may have to replace that module.
Of course this may not be your problem at all. My problem would come and go. If yours just doesn't work, then it could be a fuse.