United and Copa are partners, so you should be able to get your Copa boarding pass when you check in at EWR. As long as you have it, you will not have to go through immigration and customs at SJO. Just walk to your connecting gate. It's a small enough airport that it won't take long.