Could player discard nearest cards to place the part of `War Machine` in proper order?
No. You may only discard other cards if there are not enough open spaces. From the Fantasy Flight Chaos Marauders - Card Reference (page 14), regarding taking War Machine parts:


  ... He must then place the cards in his own battle lines - If there are not enough open spaces, he must discard cards to make room.