If you are hanging a gate on the wall, then grouting the last two cores would be ideal. Rebar in a core is pointless without filling the core with grout.
Attaching a gate to a block wall means that you will have a live load on the wall. In my experience, most mechanical anchors will eventually work loose from the gate action regardless of the use of a 4 X 4 post or hanging the gate directly to the wall.
I would suggest using an epoxy anchoring system. Red devil has a nice cartridge system you can purchase at most hardware stores that works with an existing caulk gun. The commercial epoxy systems require the purchase of an expensive dual cartridge gun that is not functional for anything else.
Follow the instructions for the epoxy and I suggest stainless bolts for anchoring so you don't have rust and corrision issues.