The orange flash indicates the attack animation is beginning, don't be fooled into blocking too early as some are telegrahed for long enough to have you block animation end before the attack lands on you. The red flash from a cyborg is the same thing. Some enemy attacks come shortly after their 'tell' of orange or red flash appears, some are slower, you just have to learn the moves and get the timing down.
Point the left stick in the direction of the enemy, not the direction of the attack as with attacks like the gekko's sweeping leg if you aim off to where the foot is at the side Riaden won't block or parry, he'll attack, so aim at the gekko's body. If you're already pushing the left analog stick in a direction when you need to block/parry then let it re-center and immediately point it in the enemy's direction, otherwise Raiden will just continue attacking while you're pressing the attack button.
The square button represents using the blade in Raiden's hand and the left analog stick obviously represents the direction Raiden is focusing on, so once you get used to it the block and parry mechanic becomes very natural.
As for the boss, stay on him, if he ends up at distance and an attack isn't imminent use your stinger attack (double-push the left analog in its direction and hit triangle) to close the distance. You can block/parry whilst mid-combo if you re-center the left stick like I said earlier, though during some of Raiden's attack animations you may have to cancel them with a quick tap of L1 or whatever to be in a position to block/parry quick enough. The tells (orange/red flashes) give plenty of time with most enemy attacks so you'll get it down in no time.