Your command write the output of the awk command to a file named "a" in the "tmp" folder (this folder is hidden), so the output of the do shell script is ""
Your command edit lines where the content of the first field is equal to "Line 2".
To edit the second line, use NR==2
To edit line 1 through 5, use NR<6
To edit line 10 through 15, use NR>9 && NR<16
Standard awk on OS X cannot edit the file in place, so you must write the output to a temporary file and use the mv command to overwrite the original file, but its possible with GNU awk 4.1.0... --> gawk -i inplace
To edit the second line of some file (the line ending in the CSV file must be a line feed), use this:
set theFile to quoted form of POSIX path of (choose file)
set tempFile to theFile & ".tmp123"
do shell script "awk -F, 'NR==2{$22=\"hello\";}1' OFS=, " & theFile & " >" & tempFile & "&& mv -f " & tempFile & " " & theFile
if the line ending in the CSV file is a carriage return, use this:
do shell script "awk -F, 'NR==2{$22=\"hello\";}1' RS='\\r' ORS='\\r' OFS=, " & theFile & " >" & tempFile & "&& mv -f " & tempFile & " " & theFile
Update
Here's an example how to put an AppleScript variable (m) into the command.
set m to 6 -- a number
do shell script "awk -F, 'NR<" & m & "{$22=\"hello\";}1' RS='\\r' ORS='\\r' OFS=, " & theFile & " >" & tempFile & "&& mv -f " & tempFile & " " & theFile