Sometimes I work out hard with weights, but afterwards I may not always be able to sleep the optimal amount or eat perfectly coordinated meals. But of course, I do try to.
As long as the soreness gradually goes away with rest and healthy eating, does this mean that I can still achieve the same gains, despite it taking longer? That is, can I spread my recovery effort over more days if each day is somewhat suboptimal?
I don't really think this is the kind of thing you can crowdsource. Everybody responds a little differently to workouts based on their individual genetics or physical conditioning. Some people can do two or three workouts a day, and come back the next day and do more. Some people take a week to recover from just one hard workout.
What you can do: Keep a workout journal and meal journal and meticulously observe your performance changes on a daily basis. If you increase your workout rate, but start to see a plateau or drop in output, consider backing off a little and increasing the amount of rest you get between workouts. In the end, it is something you will have to figure out for yourself.
Make the same gains? Well that really depends on the kind of gains you were making before. And the same compared to who? If you want to eat "paleo" then no, you will not be as likely to add monstrous slabs of muscle as someone who doesn't. However, you will live longer and be healthier because of your nutrition choices. Although paleo isn't a "low carb diet" with the nuts, seeds, and fruit in there, it certainly can be if someone is looking to eat more green vegetables, more fat/protein, less nuts/fruit to drop some bodyfat...and is much lower in carbs than a specific "bodybuilding" diet. To make big, rapid gains in muscle takes insulin. Lots of insulin, which is much more anabolic in the human body than even steroids (to a point). However, we all know the health risks, the increased cardiovascular risk, the increased risk of IDDM, the increased risks of the various autoimmune diseases that come from constant bombardment with surges and drops in insulin levels as our body responds to surges and drops in our blood glucose level.
will a paleo type diet allow you to make good progress in the gym? Sure it will. You will get stronger, more musclular, and leaner, be more "fit" than people who don't eat this way and go to the gym...however, you will never step on stage as an IFBB pro.
If you don't mind, describe your training in the gym and as someone who's been eating like the rest of you guys for what is likely much longer as I took myself from 300lbs of fat, to 170 lbs of lean, to 200lbs of even leaner, I'll be glad to compare notes and tell you what I've found works for me that you may not be hitting on in the gym.
I suggest full body workouts 3 times a week consisting of: Squat, deadlift, bench press, row, chin ups and an overhead pressing movment...preferably the clean and jerk...but even seated overhead pressing will work just fine. Split it up into squat, bench, row...squat, bench, dead, clean and jerk...squat, bench, chin up. Don't go all out lifting at your maximum effort and don't do extremely high volume. I personally only do 5 ramped sets of 5 as coach Starr reccomended...it worked way back when and it still does.